Skip to content

Instantly share code, notes, and snippets.

@felipeelias
Created November 15, 2010 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felipeelias/700925 to your computer and use it in GitHub Desktop.
Save felipeelias/700925 to your computer and use it in GitHub Desktop.
This example should not fail with rspec, but...
require 'rubygems'
require 'rspec'
class TestBug
attr_reader :array
def initialize
@array = []
end
def add(n)
@array << n
end
end
describe TestBug do
it "should NOT fail" do
@bug = TestBug.new
expect {
@bug.add(1)
}.to change {
@bug.array
}.from([]).to([1])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment