Questions tagged [rspec-mocks]

rspec-mocks is the part of the RSpec testing framework that provides test doubles: stubs, mocks and spies.

rspec-mocks is the part of the RSpec testing framework that provides test doubles: stubs, mocks and spies. It can be used with other test frameworks such as Cucumber (although it is only occasionally appropriate to use test doubles in Cucumber scenarios). It is implemented as a Ruby gem.

65 questions
0
votes
2 answers

Bundler could not find compatible versions of gem "rspec-mocks" - Bundler::VersionConflict

I try to deploy on a hosters server. But when I go to my domain, I see phusion passengers error messages: Could not find gem 'guard-rspec (= 2.5.0) ruby' in the gems available on this machine. (Bundler::GemNotFound) So I do: $ gem install…
Sadık
  • 4,249
  • 7
  • 53
  • 89
0
votes
1 answer

Rspec spec_helper configuration issue: undefined method `syntax=' for # (NoMethodError)

I am trying to confirm a function was called in a controller method with an rspec test. To do this, I'm following the relishapp documentation for setting up message expectations. However, I'm having trouble adding this snippet to…
Eric Baldwin
  • 3,341
  • 10
  • 31
  • 71
0
votes
1 answer

RSpec mocks not being called

I'm trying to create a test on a controller using an rspec mock of a model, and it seems to only work when I say Type.any_instance.should_recieve(...) instead of instancename.should_receive(...) My code looks like this. (normally I use…
bdwain
  • 1,665
  • 16
  • 35
0
votes
1 answer

rspec-mocks strange behaviour

I am encountering strange behaviour with mocks in rspec, I am m getting "'stub' NoMethodError", but when I import using require 'rspec/mocks/standalone' everything works fine. But it seems strange to me. My spec_helper: require 'rspec' require…
-1
votes
2 answers

Refactor code using mock and stubb

I am a newbie in rails and i am now trying to test my controller code using stubbs and mocks. I tried using mock on the code but i couldnt do it properly . Please help me out with the correct code which is refactored.Please help me out with the…
Aparna V
  • 179
  • 4
  • 12
1 2 3 4
5