search for: should_be_different

Displaying 1 result from an estimated 1 matches for "should_be_different".

2006 Dec 04
5
should_be_different -- possible implementation
There is an assert_difference helper for Test::Unit (you can read about it at http://blog.caboo.se/articles/2006/06/13/a-better- assert_difference and to some it should look familiar -- you know who you are :), so I took a shot at one for rSpec on Rails. class Object def should_be_different(method = nil, difference = nil) return self.should_not_eql(yield) if method.nil? before = self.send(method) yield return self.send(method).should_not_eql(before) if difference.nil? (self.send(method) - before).should_eql difference end end Usag...