search for: __mock_name

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

2007 Jan 02
4
allow stubbing of previously defined methods such as "id"
...end Index: test/mocha/auto_verify_test.rb =================================================================== --- test/mocha/auto_verify_test.rb (revision 1114) +++ test/mocha/auto_verify_test.rb (working copy) @@ -155,6 +155,11 @@ assert_equal ''named_stub'', stub.__mock_name end + def test_stub_should_respond_to_already_defined_method + stub = test_case.stub(:id=>"id") + assert_equal "id", stub.id + end + def test_should_create_greedy_stub_with_name greedy_stub = test_case.stub_everything(''named_greedy_stub'')...
2007 Jan 17
8
Mocha Mock''s hanging on after test run?
...d def test_zzz puts ActionController::Routing::Routes.named_routes.inspect assert !ActionController::Routing::Routes.named_routes end The print when test_zzz is run gives this: #<ActionController::Routing::RouteSet::NamedRouteCollection:0x14e0da8 @mocha=#<Mocha::Mock:0x2333504 @__mock_name=nil, @expectations=[#<Mocha::Expectation:0x2333158 @count=0, @parameter_block=nil, @backtrace=["test/controller/integration_test.rb:146:in `test_reset_bang_doesn_reinstall_named_routes''", "/usr/local/lib/ruby/1.8/test/unit/testcase.rb:72:in `__send__''", &quo...