notahat / machinist

Fixtures aren't fun. Machinist is.
MIT License
1.12k stars 134 forks source link

exceptions aren't raised with the proper caller stack via rspec #43

Open inspire22 opened 14 years ago

inspire22 commented 14 years ago

Not sure exactly if this is machinist's fault, but thought I'd report it.

Via console: ree-1.8.7-2010.02 > Topic.make! NameError: uninitialized constant User::Cache from /Users/inspire/Dropbox/newap/app/models/user.rb:129:in _callback_after_133' from /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/machinist-2.0.0.beta2/lib/machinist/active_record/blueprint.rb:33:invalue' from /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/machinist-2.0.0.beta2/lib/machinist/active_record/blueprint.rb:33:in outside_transaction' from /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/machinist-2.0.0.beta2/lib/machinist/shop.rb:43:inbuy' from /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/machinist-2.0.0.beta2/lib/machinist/machinable.rb:55:in make!' from /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/machinist-2.0.0.beta2/lib/machinist/machinable.rb:94:indecode_args_to_make' from /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/machinist-2.0.0.beta2/lib/machinist/machinable.rb:53:in `make!' from (irb):21

Via Rspec:

1) Model tests requires new topics to have a board Failure/Error: t = Topic.new :user => User.make!, :title => "hello world" uninitialized constant User::Cache

/Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/machinist-2.0.0.beta2/lib/machinist/active_record/blueprint.rb:33:in `value'

# /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/machinist-2.0.0.beta2/lib/machinist/active_record/blueprint.rb:33:in`outside_transaction'
# /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/machinist-2.0.0.beta2/lib/machinist/shop.rb:43:in `buy'
# /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/machinist-2.0.0.beta2/lib/machinist/machinable.rb:55:in`make!'
# /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/machinist-2.0.0.beta2/lib/machinist/machinable.rb:94:in `decode_args_to_make'
# /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/machinist-2.0.0.beta2/lib/machinist/machinable.rb:53:in`make!'
# ./spec/models/model_spec.rb:22

If it seems like its prob not machinist's fault, let me know.

BTW - you're aware of dm-sweatshop, right? They were inspired by you but added Model.pick, which picked from the currently generated models of that type. Sounds like your caching system acts similar now, but that format made a bit more sense to me.