[rspec-users] How do I use expect{}.to change().from().to() on Array?

David Chelimsky dchelimsky at gmail.com
Tue Mar 15 12:50:03 EDT 2011

On Mar 15, 2011, at 10:57 AM, niku -E:) wrote:

> Hi.
> I'm using ruby1.9.2 and rspec2.5.1
> I want to use "expect{}.to change().from().to()" like this
> https://gist.github.com/870897
> When Int class, it passed.
> When Ary class, it failed.
> Why was Ary test failed and How do I pass this test?

subject.ary returns the same object both times, whereas subject.count returns different objects each time. Make sense?

More information about the rspec-users mailing list