search for: mock_with

Displaying 7 results from an estimated 7 matches for "mock_with".

2010 Nov 12
2
pending tests fail when I switch to mock_with :mocha
...nto how better to search existing threads in this mailing list. Ok to my rspec 2.0.1 mocha 0.9.8 issue: given a controller test before do subject.expects(:authenticate).once end it "should bla bla" do pending "PENDING, shouldn''t fail?" end with config.mock_with :rspec it''s ok: pending, but with config.mock_with :mocha if fails! It expected the authenticate to be called. What do I have to do to make it compatible? Reason for using mocha, is A: I''m used to it B: I don''t know rspec mocks too well, but it notice that these mock...
2011 Feb 25
7
Rspec2 for rails 2.3.8?
Hi experts, I picked up a copy of the rspec book and wrote some tests in spec/lib and spec/models for my Rails 2.3.8 code. I was using rspec 2.5.1, rspec-core 2.5.0, rspec-expectations 2.5.0 et. al. But I realised that the rspec-rails version I am using is meant for Rails3. Which version of rspec-rails should I use for Rails 2.3.8? Best, Radhesh -- Posted via http://www.ruby-forum.com/.
2009 Mar 15
7
How to use different mocking frameworks?
...new to Rspec, so hope someone can help me out with this. I''m leveraging a couple pre-existing applications in my current project, both have fairly robust test suites in Rspec already. However, one is using Rspec''s builit in mocking, and the other is using mocha. If I set config.mock_with mocha in spec_helper.rb, then all of the rspec mocks fail. If I comment this out, all of the specs with mocha fail. Is there some way to set the mocking framework on a test and/or file basis? I''ve been all over Google, and can''t seem to find a resolution to this. I really don&...
2009 Jun 13
2
removing Mocha; 'spec spec' fails but the specific model file passes
...the user_spec.rb file, everything is fine....rspec goes through the User model. However, if you run all the specs, it is somehow still using mocha instead of the User model. How is this possible since I removed the configuration for mocha.? In spec_helper.rb, I commented out the line: # config.mock_with :mocha I also saw a require ''mocha'' statement in test_helper that I removed. --------------------------------------------------------------------------------------------------------------------- 11:41 /c/work/quizmaker_demo (questions)$ spec spec ...................................
2007 Sep 25
12
Problems with expect_render
...''ve been working with RSpec for about a week now, and the process of moving from a Test::Unit + Mocha setup to an RSpec + Mocha environment has been pretty straightforward. Except, I''m having problems with using template.expect_render. I have Mocha enabled with: > config.mock_with :mocha in spec_helper. And then I have a view spec which looks like this: > it "should explode messily because I have made this partial name > up" do > template.expect_render(:partial => ''does_not_exist'', :object => > "hello") > r...
2007 Apr 16
0
Fwd: ANN: FlexMock 0.6.0 Released
FYI - Jim Weirich just released an rspec-compatible version of FlexMock. For those of you using trunk, you can now use either FlexMock, Mocha, or RSpec''s built-in mocking framework by saying: Spec::Runner.configure do |config| config.mock_with :flexmock # or :mocha or :rspec (default) end The choice is yours. Mock in peace. Cheers, David ---------- Forwarded message ---------- From: Jim Weirich <jim at weirichhouse.org> Date: Apr 15, 2007 9:34 PM Subject: ANN: FlexMock 0.6.0 Released To: ruby-talk ML <ruby-talk at ruby-lang....
2007 Apr 04
11
ANN: RSpec 0.9.0 beta-1 available for download.
We''d like to get some feedback on RSpec 0.9 before we start pushing out releases via Rubyforge''s gem server and update the website. We have therefore made the first beta of 0.9 available - both prepackaged and tagged in subversion (see below). RSpec 0.9 introduces a new API for expectations, which essentially means that your underscores go away (there has been other discussions