Skip to content

Commit

Permalink
Machinist.reset_before_test was removed in 2839888
Browse files Browse the repository at this point in the history
  • Loading branch information
sobrinho committed Jun 2, 2011
1 parent 0082aab commit 3c35957
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
17 changes: 6 additions & 11 deletions lib/generators/machinist/install/install_generator.rb
Expand Up @@ -15,22 +15,13 @@ def blueprints_file
end

def test_helper
if rspec?
inject_into_file("spec/spec_helper.rb", :after => "RSpec.configure do |config|\n") do
" # Reset the Machinist cache before each spec.\n" +
" config.before(:each) { Machinist.reset_before_test }\n\n"
end
else
if test_unit?
inject_into_file("test/test_helper.rb", :after => "require 'rails/test_help'\n") do
"require File.expand_path(File.dirname(__FILE__) + '/blueprints')\n"
end
inject_into_class("test/test_helper.rb", ActiveSupport::TestCase) do
" # Reset the Machinist cache before each test.\n" +
" setup { Machinist.reset_before_test }\n\n"
end
end
end

def cucumber_support
if cucumber?
template "machinist.rb.erb", "features/support/machinist.rb"
Expand All @@ -43,6 +34,10 @@ def rspec?
options[:test_framework].to_sym == :rspec
end

def test_unit?
options[:test_framework].to_sym == :test_unit
end

def cucumber?
options[:cucumber]
end
Expand Down
3 changes: 0 additions & 3 deletions lib/generators/machinist/install/templates/machinist.rb.erb
Expand Up @@ -5,6 +5,3 @@ require "#{Rails.root}/spec/support/blueprints"
# Load the blueprints from over in test.
require "#{Rails.root}/test/blueprints"
<%- end -%>

# Reset the Machinist cache before each scenario.
Before { Machinist.reset_before_test }

0 comments on commit 3c35957

Please sign in to comment.