Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #83 from sobrinho/master

Object caching was removed, cleanup the generators.
  • Loading branch information...
commit c32193d06e5efa402cdd867d1009df996c7283f5 2 parents 67c6b28 + 3c35957
@notahat notahat authored
View
22 lib/generators/machinist/install/install_generator.rb
@@ -15,24 +15,15 @@ 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 options[:cucumber]
+ if cucumber?
template "machinist.rb.erb", "features/support/machinist.rb"
end
end
@@ -43,6 +34,13 @@ 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
end
end
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.