search for: stub_everyth

Displaying 6 results from an estimated 6 matches for "stub_everyth".

2007 Jul 04
0
Fwd: [ mocha-Bugs-11885 ] never doesn''t work with stub_everything
---------- Forwarded message ---------- From: noreply at rubyforge.org <noreply at rubyforge.org> Date: 30-Jun-2007 14:33 Subject: [ mocha-Bugs-11885 ] never doesn''t work with stub_everything To: noreply at rubyforge.org Bugs item #11885, was opened at 2007-06-27 14:13 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=7477&aid=11885&group_id=1917 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Alexander Lang...
2006 Oct 25
2
Isn''t it possible to stub / expect on :id ?
Hi all ! Running this: @payout = stub_everything(:id => 141) Payout.stubs(:find).with(@payout.id).returns(@payout) Generates this warning: ./test/functional/payouts_controller_test.rb:22: warning: Object#id will be deprecated; use Object#object_id What am I missing ? :id is a fairly frequent method to override in Rails-based applications...
2007 Jan 02
4
allow stubbing of previously defined methods such as "id"
...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'') assert_equal ''named_greedy_stub'', greedy_stub.__mock_name
2007 Jan 17
8
Mocha Mock''s hanging on after test run?
...200:in `run''", "/usr/local/lib/ruby/1.8/test/unit/autorunner.rb:13:in `run''", "/usr/local/lib/ruby/1.8/test/unit.rb:278", "test/controller/integration_test.rb:6"], @return_value=nil, @parameters=** any **, @invoked=4, @method_name=:install>], @stub_everything=false>, @module=#<Module:0x14e0d44>, @helpers=[], @routes={}> This is a big deal because this causes tests to fail in other places in the framework. Ideas? -- Kevin Clark http://glu.ttono.us
2006 Oct 08
9
Organizing tests and mocha expectations
I''m simultaneously getting into using Mocha and RSpec-style tests (courtesy of the simply_bdd plugin) and I''m struggling with some issues while trying to organize my specs/test. Here''s a code example illustrating the problem: context "update cliient invalid data" do include ClientsControllerSpecHelper specify "should render edit form" do
2006 Sep 08
1
A quick guide to Mocha
Hello :) Having just gone through the (admittedly simple) API of Mocha to learn how it works, I wrote a quick guide (190 lines) to help others get up to speed. I''ve attached it as RDOC and as HTML. It is a first draft - please help me improve by giving feedback ! Contents : Overview - Quick overview of Mocha Unit testing, mock object and stubs - Very quick introduction to mock