Re: [rspec-users] Mocking find_by_sql

2009-06-06 Thread Hunt Jon
You might not be understanding the usage of mock very well. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Mocking find_by_sql

2009-06-06 Thread Fernando Perez
> Same deal as your other post about find_by_sql. Set the message > expectation on the method on the class: > > Post.should_receive(:paginate) Unfortunately it doesn't work :-( I'll have to dive into the will_paginate source code to find out how it plugs itself in AR. -- Posted via http://www.r

Re: [rspec-users] Mocking find_by_sql

2009-06-05 Thread David Chelimsky
On Fri, Jun 5, 2009 at 3:29 PM, Fernando Perez wrote: > Hi, I cannot manage to mock a call to find_by_sql. Which class is > actually getting called? It is not the model, and I tried ActiveRecord > which didn't work either. It's the model's class: class Foo < AR::Base; end describe Foo do it "

Re: [rspec-users] Mocking find_by_sql

2009-06-05 Thread David Chelimsky
On Fri, Jun 5, 2009 at 3:33 PM, Fernando Perez wrote: > Damn I can't mock will_paginate's paginate method either!!! Same deal as your other post about find_by_sql. Set the message expectation on the method on the class: Post.should_receive(:paginate) > -- > Posted via http://www.ruby-forum.com/

[rspec-users] Mocking find_by_sql

2009-06-05 Thread Fernando Perez
Hi, I cannot manage to mock a call to find_by_sql. Which class is actually getting called? It is not the model, and I tried ActiveRecord which didn't work either. -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforg

Re: [rspec-users] Mocking find_by_sql

2009-06-05 Thread Fernando Perez
Damn I can't mock will_paginate's paginate method either!!! -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users