Created
January 5, 2013 13:26
-
-
Save urbanautomaton/4461579 to your computer and use it in GitHub Desktop.
This file contains 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 'rspec' | |
class Thing; end | |
describe "change matcher" do | |
it "behaves counterintuitively with classes" do | |
thing = nil | |
expect { | |
thing = Thing | |
}.to change { | |
thing | |
}.from(nil).to(Thing) | |
end | |
end |
This file contains 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
$ rspec change_matcher_spec.rb | |
F | |
Failures: | |
1) change matcher behaves counterintuitively with classes | |
Failure/Error: expect { | |
result should have been changed to Thing, but is now Thing | |
# ./rspec_change_behaviour_spec.rb:8:in `block (2 levels) in <top (required)>' | |
Finished in 0.00233 seconds | |
1 example, 1 failure |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment