Created
June 18, 2010 19:34
-
-
Save fj/444102 to your computer and use it in GitHub Desktop.
Found a bug in 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
#RSpec 1.3.0, #Ruby 1.9.1 | |
describe "Simple class" do | |
before :each do | |
@c = Class.new do | |
attr_accessor :apple | |
end.new | |
@c.apple = [] | |
end | |
it "should change values" do | |
# Passes, but it's a false positive: | |
# `apple` is `[]`, not `nil` | |
->{ @c.apple = 100 }.should change(@c, :apple).from(nil).to(100) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment