Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

`Machinist.reset_before_test` was removed in 2839888

  • Loading branch information...
commit 3c359578e7fa0ff4c5fef73f6b21327992cc2fdd 1 parent 0082aab
@sobrinho sobrinho authored
View
17 lib/generators/machinist/install/install_generator.rb
@@ -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"
@@ -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
View
3  lib/generators/machinist/install/templates/machinist.rb.erb
@@ -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 }
Please sign in to comment.
Something went wrong with that request. Please try again.