Martin
unread,Sep 27, 2010, 2:26:57 PM9/27/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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