On Wed, Feb 18, 2009 at 9:40 PM, Stephen Eley <sfe...@gmail.com> wrote: > On Wed, Feb 18, 2009 at 11:42 PM, Yi Wen <hayafi...@gmail.com> wrote: > > validates_presence_of happens to be the name of the method in > ActiveRecord that does that. But if you decide to write your own > check_to_see_if_this_thingy_is_in_my_whatsis() method that does the > same thing, a good *behavior* spec will not break. Because the > behavior remains the same.
I think you're talking about state-based, blackbox testing, rather than behavior-based whitebox testing. RSpec unit tests are all about speccing that one object calls another object's method at the right time. The idea being that if that behavior occurs, and that the other object's method has been similarly tested, that you're OK. ///ark _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users