Last active
August 29, 2015 14:03
-
-
Save apotonick/a8d6108a249b6071d3e9 to your computer and use it in GitHub Desktop.
Ideas for spec DSL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Notes:
https://www.relishapp.com/rspec/rspec-core/v/2-6/docs/subject/explicit-subject
and
http://betterspecs.org/#subject