Created
February 4, 2013 07:19
-
-
Save anonymous/4705398 to your computer and use it in GitHub Desktop.
What a minitest would look like if the test case object passed bare matcher methods in an "it" block to a "subject" in scope. Like RSpec :)
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
require 'minitest/autorun' | |
describe Person do | |
describe 'direct' do | |
subject { Person.new({pet: true}).pet? } | |
it { must_be true } | |
end | |
describe 'indirect' do | |
subject { Person.new({pet: true}) } | |
it { must_be :pet? } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Actually I think what you are looking for is covered here: http://blog.arvidandersson.se/2012/03/28/minimalicous-testing-in-ruby-1-9
And