Path: | lib/minitest/spec.rb |
Last Update: | Fri Jul 13 15:09:41 +0000 2012 |
Define an expectation with name desc. Name gets morphed to a proper test method name. For some freakish reason, people who write specs don‘t like class inheritence, so this goes way out of its way to make sure that expectations aren‘t inherited.
This is also aliased to specify and doesn‘t require a desc arg.
Hint: If you do want inheritence, use minitest/unit. You can mix and match between assertions and expectations as much as you want.
Essentially, define an accessor for name with block.
Why use let instead of def? I honestly don‘t know.
Another lazy man‘s accessor generator. Made even more lazy by setting the name for you to subject.