search for: message_expectation

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

2007 Dec 29
15
Do you think it would look cleaner?
I was looking over some of my specs. I was thinking that the following: @game.should_receive(:name).and_return(''The Battle for Blaze'') @game.should_receive(:people).and_return(5000000) @game.should_receive(:activated).and_return(true) Would it look cleaner if I could do this instead? @game.should_recieve_and_return( :name => ''The Battle for Blaze''
2008 Nov 13
6
.with(:anything) issue
Hi, I''m using a expectation like this : repository.should_receive(:add_gem).with("test.txt", :anything) When I run my spec, it fails with the following message : Spec::Mocks::MockExpectationError in ''MiniGemServer should add a new gem to the repository after it has been uploaded'' #<MiniGemServer::Repository:0xb11164> expected :add_gem with
2008 Sep 13
3
RCov / RSpec segfaults on Ubuntu
...' exists? Failing that - any good resources / tips for working around these segfault issues - any ''no go areas'' we can just avoid in our specs? I noticed, for example, that one of our projects consistently segfaulted on this line: /vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb:41: [BUG] Segmentation fault Any pointers greatly appreciated. cheers, Matt [1]http://eigenclass.org/hiki/rcov+FAQ#l11 [2]http://eigenclass.org/hiki/rcov-0.8.1 ---- http://blog.mattwynne.net http://songkick.com In case you wondered: The opinions expressed in this email are my own and do...
2007 May 10
5
Shared behavior and_raise problem, and site aestetics
Hello, Is anyone else having trouble with the and_raise method on mocks, with respect to shared behaviors? If I do the following instead: foo.should_receive(:bar).and_return { raise } everything seems to work. I have been supplying no arguments to and_raise, by the way. Also, you may want to make the background in the code examples on the home page a little lighter. I am hardly able to
2007 Feb 15
17
Odd parameter munging with with()
Hi, I have this setup block: setup do session[:login] = ''jhughes'' @user = mock("user") User.stub!(:find).and_return(@user) @params = {:cn => "Bilbo Baggins", :telephoneNumber => "416-277-4418", :mail => "bilbo at baggins.com"} end And then this spec: specify "should update and save the
2007 Jul 26
5
Coding standards and whitespace
...d_to.rb rspec/lib/spec/matchers/satisfy.rb rspec/lib/spec/matchers/throw_symbol.rb rspec/lib/spec/matchers.rb rspec/lib/spec/mocks/argument_constraint_matchers.rb rspec/lib/spec/mocks/argument_expectation.rb rspec/lib/spec/mocks/error_generator.rb rspec/lib/spec/mocks/errors.rb rspec/lib/spec/mocks/message_expectation.rb rspec/lib/spec/mocks/methods.rb rspec/lib/spec/mocks/mock.rb rspec/lib/spec/mocks/order_group.rb rspec/lib/spec/mocks/proxy.rb rspec/lib/spec/mocks/space.rb rspec/lib/spec/mocks/spec_methods.rb rspec/lib/spec/mocks.rb rspec/lib/spec/rake/spectask.rb rspec/lib/spec/rake/verify_rcov.rb rspec/lib/s...
2009 Apr 19
19
Controller spec: testing that scope is set
In a Rails controller I set the scope on a model class in an around filter. I have defined expectations on the model classes, and ideally, I would add a further expectation for the scope. Is this already possible in some way? How would I go about adding support a scope expectation? Michael -- Michael Schuerig mailto:michael at schuerig.de http://www.schuerig.de/michael/