Displaying 2 results from an estimated 2 matches for "yielded_parameters".
2006 Sep 29
1
yielding consecutive values
...I made these changes...
Index: test/mocha/expectation_test.rb
===================================================================
--- test/mocha/expectation_test.rb (revision 62)
+++ test/mocha/expectation_test.rb (working copy)
@@ -91,6 +91,11 @@
assert_equal parameters_for_yield, yielded_parameters
end
+ def test_should_yield_with_block_result
+ expectation = new_expectation.yields( lambda { ''lambda return
value'' } )
+ expectation.invoke() { |*parameters| assert_equal [''lambda
return value''], parameters }
+ end
+
def test_should_return_...
2006 Sep 29
2
multiyield
..., I wrote multiyield....
Index: test/mocha/expectation_test.rb
===================================================================
--- test/mocha/expectation_test.rb (revision 62)
+++ test/mocha/expectation_test.rb (working copy)
@@ -91,6 +91,13 @@
assert_equal parameters_for_yield, yielded_parameters
end
+ def test_should_yield_multiple_times_with_multiyield
+ expectation = new_expectation.multiyield(:foo, 1, ''bar'')
+ actual = []
+ expectation.invoke() { |parameter| actual << parameter }
+ assert_equal [:foo, 1, ''bar''], actual
+ end
+...