Hi James,
Here is my gemfile...
https://gist.github.com/2570515
I just did some experimenting and narrowed the problem down to
serialization...
If I do:
class Purchase < ActiveRecord::Base
serialize :txn
end
And then from the context of my rspec tests, launch pry as a debugger:
[1] pry(#<RSpec::Core::ExampleGroup::Nested_1::Nested_1>)> p =
Purchase.create!
=> #<Purchase id: 1, created_at: "2012-05-01 19:03:44", updated_at:
"2012-05-01 19:03:44", txn: nil>
[2] pry(#<RSpec::Core::ExampleGroup::Nested_1::Nested_1>)> p.save
=> true
[3] pry(#<RSpec::Core::ExampleGroup::Nested_1::Nested_1>)> p.txn =
stub("lol")
=> #<Mock:lol>
[4] pry(#<RSpec::Core::ExampleGroup::Nested_1::Nested_1>)> p.save
NoMethodError: undefined method `matches_method?' for nil:NilClass
from /Users/bountybuy/.rvm/gems/ruby-1.9.3-p125@bountybuy/gems/
mocha-0.10.5/lib/mocha/mock.rb:185:in `respond_to?'
[5] pry(#<RSpec::Core::ExampleGroup::Nested_1::Nested_1>)>
-patrick