search for: alwaysequal

Displaying 2 results from an estimated 2 matches for "alwaysequal".

2006 Sep 22
2
foo.expects(:blah).returns(10).then(11) syntax
...lib/mocha/expectation.rb =================================================================== --- lib/mocha/expectation.rb (revision 854) +++ lib/mocha/expectation.rb (working copy) @@ -21,7 +21,7 @@ @method_name = method_name @count = 1 @parameters, @parameter_block = AlwaysEqual.new, nil - @invoked, @return_value = 0, nil + @invoked = 0 @backtrace = backtrace || caller end @@ -69,19 +69,29 @@ end def returns(value) - @return_value = value + return_value << value self end + + def then(value) + return...
2007 Mar 12
10
using mocha with rspec
Hi folks. I''ve just started using rspec and I have to say it''s very nice. The thing is, I prefer mocha''s mocking dialect. So I thought a simple require ''mocha'' would set me up. Unfortunately, rspec does all its goodness using do/end blocks in anonymous classes, so it wasn''t quite that obvious. Anyway, here is the incantation I ended up