similar to: Fwd: [ mocha-Bugs-5892 ] Using a setup method in test_case_class destroys subsequent test cases

Displaying 20 results from an estimated 700 matches similar to: "Fwd: [ mocha-Bugs-5892 ] Using a setup method in test_case_class destroys subsequent test cases"

2006 Sep 13
2
Problem with RSpec and Mocha/Stubba
I''ve recently upgraded to the latest versions of Mocha and RSpec (0.3.2 and 0.6.3 respectively) and I''m no longer able to use Mocha/ Stubba with RSpec. Its actually only Stubba I''m interested in as I use RSpec''s built-in mocking library. I require stubba in my spec file but whenever I try and run my spec it fails with the error: Unintialized constant
2006 Sep 18
2
Mocha + Selenium-on-rails loading problem ?
Hello All, I need to stub two class methods before a selenium call. The .rsel is : require ''mocha'' SalesConfigWork.stubs(:load_work_data) SalesConfigWork.stubs(:delete_work_data) setup :fixtures => :sales_config_works open "/" The Selenium test runner result is : undefined method `stubs'' for SalesConfigWork:Class Extracted source (around line *#0*):
2006 Oct 25
5
Mocha, Stubba and RSpec
Hi, I''ve been reading with interest the threads trying to integrate Mocha and Stubba with RSpec. So far, I''ve made the two changes in spec_helper.rb suggested, but discovered another one that neither of the archives mentions: If you use traditional mocking: object = mock or the stub shortcut : object = stub(:method => :result), you run into namespace conflicts with
2007 Apr 11
0
Fwd: [ mocha-Feature Requests-5856 ] Stubbing of private methods should be allowed
---------- Forwarded message ---------- From: noreply at rubyforge.org <noreply at rubyforge.org> Date: 11-Apr-2007 15:31 Subject: [ mocha-Feature Requests-5856 ] Stubbing of private methods should be allowed To: noreply at rubyforge.org Feature Requests item #5856, was opened at 2006-09-22 17:03 You can respond by visiting:
2007 Dec 23
0
Fwd: [ mocha-Bugs-16523 ] Ruby 1.9 gives warning
FYI - I''ve just released Mocha 0.5.6 to make Ruby 1.9 compatibility fixes available for those using released packages rather than subversion trunk. I''m not feeling well and so haven''t been able to test it other than by running all the tests using Ruby 1.9. Please let me know if you have any problems using it. Remember that it sometimes takes a while for a new gem
2007 Apr 11
0
Fwd: [ mocha-Bugs-6416 ] Mock objects shouldn''t define #to_s
---------- Forwarded message ---------- From: noreply at rubyforge.org <noreply at rubyforge.org> Date: 11-Apr-2007 15:07 Subject: [ mocha-Bugs-6416 ] Mock objects shouldn''t define #to_s To: noreply at rubyforge.org Bugs item #6416, was opened at 2006-10-31 15:34 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=7477&aid=6416&group_id=1917
2006 Sep 25
3
Problem stubbing instances referred to by constants
Hi James, An instance retains its mocha between tests if that instance is pointed to by a constant. The simplest failing test is something like (add as a new file in mocha/test).. #--code-- require File.join(File.dirname(__FILE__), "test_helper") require ''stubba'' class WemStubbaTest < Test::Unit::TestCase Arr = [1, 2, 3] def test_a
2006 Sep 03
1
Slimmed down version for inclusion in Rails?
I''m pushing a major overhaul in testing the Rails codebase. Mocha and stubba make my life easy so that''s what I''m using. The first major patch using them is in RailTies (http://dev.rubyonrails.org/ticket/5970) now. I spoke to DHH today about using it in the other libraries and I think it''ll be ok, but they really want to include as little code as needed. I
2006 Dec 14
3
Stubbing constructiors
This works: class X def X.initialize( stuff ) end end X.initialize("bla") However stubbing it doesn,t: require ''test/unit'' require ''stubba'' class X def X.initialize( stuff ) end end class XTest < Test::Unit::TestCase def test_ X.stubs(:initialize).with("bla")
2006 Dec 14
1
Patch: make rdoc of lib/mocha/object.rb instead of lib/stubba/object.rb
Index: Rakefile =================================================================== --- Rakefile (revision 73) +++ Rakefile (working copy) @@ -23,7 +23,7 @@ task.rdoc_dir = ''doc'' task.template = "html_with_google_analytics" task.options << "--line-numbers" << "--inline-source" -
2007 Jan 24
0
Mocha 0.4 released
So I finally got round to releasing a new version<http://rubyforge.org/frs/?group_id=1917&release_id=9184>of Mocha <http://mocha.rubyforge.org/>. Much of the functionality has been available for some time if you''ve been using the Rails plugin based on subversion HEAD, but now you can get it in all in a gem (or other package). The most recent changes centre around allowing
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:
2007 Feb 02
0
Fwd: [ mocha-Bugs-7834 ] infinte_range.rb makes incorrect assumption about to_f
Thanks for reporting the bug below. You''re absolutely right. Renamed Range#to_s implementation to #mocha_inspect and checked first and last respond_to?(:to_f) as you suggested. Sorry for the delay - I wasn''t monitoring the rubyforge trackers. I am now! Should be fixed in revision 99 of trunk. -- James. http://blog.floehopper.org ---------- Forwarded message ---------- From:
2007 Apr 11
0
Fwd: [ mocha-Bugs-8687 ] Block''s return value is dropped on stubbed yielding methods.
---------- Forwarded message ---------- From: noreply at rubyforge.org <noreply at rubyforge.org> Date: 11-Apr-2007 15:31 Subject: [ mocha-Bugs-8687 ] Block''s return value is dropped on stubbed yielding methods. To: noreply at rubyforge.org Bugs item #8687, was opened at 2007-02-15 17:29 You can respond by visiting:
2006 Aug 17
1
expectations on stubs (stubba) or mock methods on existing classes?
Hello, First, thanks for releasing Mocha. As someone who''s been practicing TDD much longer than I''ve been using Rails, one of my biggest complaints has always been the fact that the "Unit" tests are more like intefration tests because of how tightly coupled the domain model is when using ActiveRecord. Stubba looks like it could really help aleviate this problem. The
2007 Sep 11
1
Fwd: [ mocha-Feature Requests-13763 ] add with_any_arguments method
---------- Forwarded message ---------- From: noreply at rubyforge.org <noreply at rubyforge.org> Date: 7 Sep 2007 22:43 Subject: [ mocha-Feature Requests-13763 ] add with_any_arguments method To: noreply at rubyforge.org Feature Requests item #13763, was opened at 2007-09-07 17:43 You can respond by visiting:
2007 Mar 04
4
Rails functional testing and Mocha
I''ve always wanted to be able to do stuff like this in my functional tests c = customers(:customer_1) c.expects(:great_customer_service) post :service_customer, :id => c.id This of course fails because inside the rails action a different instance of customer is used. Some of the time setting your expectation/stubbing on Customer.any_instance works, but it''s not
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
2006 Sep 11
1
Aliasing type method in Mocha
Hi, (Mocha and Stubba are great, btw.) Is there any way to alias the call to .type in Mocha? The issue is that AR effectively aliases the normal type method for the Column class (for whatever Adapter.) My code is reflecting on the adapter methods to iterate over the columns in a particular model. This makes it hard to write test code that stubs out columns and mocks my models. E.g. cols =
2006 Sep 03
0
Reducing object polution and mocha?
Hi Kevin, Not currently, I''m afraid - I always realised it was a possible problem, but we haven''t run into it in our use of Mocha so far. I guess you''re pushing the envelope with it, which is great. If you only need to do it for one or two objects, you could just undefine the offending methods. In the meantime I''ll look into a better solution. It may not be