views:

22

answers:

0

I have a simple spec test in my Ruby on Rails application:

stub.instance_of(Search).x { 3 }
puts Search.new.x # displays 3
puts Search.first.x # gives me an error: undefined method `x' for #<Search:0xb5fabaa8>

why does the third line fail? Search.first does return an instance of Search.

Thanks