Skip to content

Commit

Permalink
Merge pull request notahat#83 from sobrinho/master
Browse files Browse the repository at this point in the history
Object caching was removed, cleanup the generators.
  • Loading branch information
notahat committed Jun 19, 2011
2 parents 67c6b28 + 3c35957 commit c32193d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
22 changes: 10 additions & 12 deletions lib/generators/machinist/install/install_generator.rb
Expand Up @@ -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
Expand All @@ -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
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 c32193d

Please sign in to comment.