Undefined method `reset_before_test' for Machinist:Module

111 views
Skip to first unread message

Martin

unread,
Sep 27, 2010, 2:26:57 PM9/27/10
to Machinist Users
Hi,

From what I can see is the Machinist module loaded, but for some
reason it doesn´t have the rest_before_test method available.
Is there any other libraries I should have included somewhere?


$ rake:test units
NoMethodError: undefined method `reset_before_test' for
Machinist:Module
/Users/martins/Work/jubel/test/test_helper.rb:11:in `block in
<class:TestCase>'
/Users/martins/.rvm/gems/ruby-1.9.2-p0@jubel/gems/
activesupport-3.0.0/lib/active_support/callbacks.rb:414:in
`_run_setup_callbacks'
/Users/martins/.rvm/gems/ruby-1.9.2-p0@jubel/gems/
activesupport-3.0.0/lib/active_support/testing/setup_and_teardown.rb:
34:in `run'


$ rails c test
Loading test environment (Rails 3.0.0)
ruby-1.9.2-p0 > gem 'machinist'
=> true
ruby-1.9.2-p0 > Machinist.methods.grep(/reset/)
=> []



Gemfile:
group :test, :development do
gem 'shoulda'
gem 'faker'
gem 'machinist'
end

$ bundle list machinist => 1.0.6


test_helper.rb:
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/
environment")
require File.expand_path(File.dirname(__FILE__) + "/blueprints")
require 'faker'
require 'sham'


class ActiveSupport::TestCase
setup { Machinist.reset_before_test }
setup { Sham.reset }
end



I highly appreciate any help or tips to get this working!


Best,
Martin

Pete Yandell

unread,
Sep 27, 2010, 8:33:28 PM9/27/10
to Machinist Users
Ummm, looks like you're using Machinist 1. The reset_before_test
method is only in Machinist 2 beta.

- Pete

Martin Stabenfeldt

unread,
Sep 28, 2010, 1:49:23 AM9/28/10
to machini...@googlegroups.com
Hmm, right you are.
Thanks! :)

--
Martin


2010/9/28 Pete Yandell <pe...@notahat.com>
Ummm, looks like you're using Machinist 1. The reset_before_test
method is only in Machinist 2 beta.

- Pete

--
You received this message because you are subscribed to the Google Groups "Machinist Users" group.
To post to this group, send email to machini...@googlegroups.com.
To unsubscribe from this group, send email to machinist-use...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/machinist-users?hl=en.




--
Martin Stabenfeldt
Tlf: +47 93441707
Reply all
Reply to author
Forward
0 new messages