> Having trouble following your example. Why do you have to pass
> Bar.new(nil, nil) for this test? 

Because the shared example is testing the method #build_name from the module
that is included in the various classes-- it needs the object that #build_name
is attached to in order to test the functionality.

The .new(nil, nil) is because the initialize method of the classes that include
the module have expected arguments...  I supposed I could have done

def initialize(arg1 = nil, arg2 = nil)

to prevent having to do Bar.new(nil, nil) in the test, but I actually would
rather the init method have actual argument expectations.


Patrick J. Collins
http://collinatorstudios.com
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to