Skip to content

Instantly share code, notes, and snippets.

@apotonick
Last active August 29, 2015 14:03
Show Gist options
  • Select an option

  • Save apotonick/a8d6108a249b6071d3e9 to your computer and use it in GitHub Desktop.

Select an option

Save apotonick/a8d6108a249b6071d3e9 to your computer and use it in GitHub Desktop.
Ideas for spec DSL
describe "#inherit!" do
# this would usually go in a before block and let and totally obfuscate what i wanna do:
# also, this would be run once while the it blocks below are isolated.
parent = Definitions.new([title, length])
child = Definitions.new([stars])
child.inherit!(parent)
# make sure parent's definitions were cloned.
# i'm fine with those it {} blocks:
it { child.must_equal([stars, title, length]) }
it { child[0].object_id.must_equal stars.object_id }
it { child[1].object_id.wont_equal title.object_id }
it { child[2].object_id.wont_equal length.object_id }
end
@shamanime
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment