On Jul 9, 2007, at 5:00 PM, Daniel N wrote:

My Bad... Please ignore

On 7/10/07, Daniel N <[EMAIL PROTECTED]> wrote:
  it "should find all users" do
User.should_receive(:find).with( :all, :limit => 10 ).and_return ([EMAIL PROTECTED])
    do_get
  end

Sorry for piggybacking on your post, but since you've apparantly figured out your isssue I have a slightly similar question; sometimes I have (in ActiveRecord) a verbose #find I want to mock out using should_receive, maybe looking something along this: Foo.find(:all, :select => "foos.*, bars.*, :joins => "join bazzers on foos.baz_id = ..", :conditions => "quux = 1", etc etc) ... But all I really may care about with a specific mock expectation is that it gets the right :conditions key in the passed-in hash.

Is there a way in RSpec to check for a specific hash key (or evaluating other things along those lines) in the parameter expectation using the should_receive(:find).with(...) construct?

JS

_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to