machinist
machinist copied to clipboard
Associations Deprecation Warning
I get the following warning when using associations:
DEPRECATION WARNING: Object#returning has been deprecated in favor of Object#tap. (called from block (2 levels) in <top (required)> at ~/SP/spec/spec_helper.rb:73)
The relevant line of code is...
Survey.blueprint do user name { Faker::Lorem.words(3).join(" ") } intro { Faker::Lorem.paragraph } pubid { 7.times.map { ('a'..'z').to_a.sample }.join } pubdate { 1.days.ago } enddate { 7.days.from_now } end
which is called in the test...
it 'should have surveys' do @u.surveys.make end
where @u is a user object.
I'm using ruby version 1.9.2p0, Rails 3, and Machinist 2.0.0.beta2 managed by RVM.
Wow, it definitely removed all the line breaks from my code. Rest assured, it's not all on one line.
I think this has to do with the faker gem, I can't find returning in the machinist code anywhere, while faker has 3 instances of it. Relevant file is lib/faker/lorem.rb lines 15 and 27.
To bad the faker gem is not on GitHub as far as I know.
You can use the 'ffaker' gem as it's maintained and supposedly faster.