Hi guys. When I stub a method chain that includes a method named "desc", 
Ruby complains:

private method `desc' called for #<Object:0xd1441e8>

Is there any way around this? As far as I know, #desc is a private method 
that RSpec adds to mocks. I'm using rspec-rails 2.10.1 .

Here's the code:
  ProductHave.for_sale.limit(20).desc('sale_config.created_at').each do |ph|

And here's the stub:
  ProductHave.stub_chain(:for_sale, :limit, :desc).
    and_return [ph1, ph2, ph3, ph4, ph5, ph6]

Thanks!
Nick

-- 
You received this message because you are subscribed to the Google Groups 
"rspec" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rspec/-/hYV2W_Ks8noJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rspec?hl=en.

Reply via email to