On 16 Apr 2008, at 12:34, Edvard Majakari wrote: > you could consider implementing > class method new_valid for each of your objects, so that whenever the > concept of a valid object changes, there's > only one place you have to fix.
Or equally, you could have a Factory class that knows how to create valid objects. This can be handy for generating test data, and separates it from the class under test. (Some metaprogramming would let you define that in one class and still have it available as MyModel.new_valid.) Zubin - I am still leaning towards the mock approach though, unless you don't have integration tests for your app, in which case having a model-layer test suite would add value. (But full-stack integration tests + model unit tests would be better). Ashley -- http://www.patchspace.co.uk/ http://aviewfromafar.net/ _______________________________________________ rspec-users mailing list [email protected] http://rubyforge.org/mailman/listinfo/rspec-users
