Displaying 1 result from an estimated 1 matches for "data_hash".
Did you mean:
  data_base
  
2006 Aug 17
1
expectations on stubs (stubba) or mock methods on existing classes?
...like it could really help
aleviate this problem.
The one problem I''m having though, is that I want to be able to stub
out a method on an existing class _and_ use the mock expectations on
that method.
Basically, I have a Product class (ActiveRecord) that has a
class-method Product.import(data_hash). I want to test that this
method calls -- among other things -- Product.create with the correct
arguments.
I was trying to do:
    def test_import_should_create_product_when_it_does_not_exist
      Product.stubs( :create ).with( expected_arguments ).times( 1 )
      Product.import( import_line )...