Skip to content

Commit

Permalink
Don't let the test_app generator destroy our Gemfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Stirk committed Jul 7, 2011
1 parent 0191277 commit e3b4dd9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Rakefile
Expand Up @@ -19,6 +19,11 @@ desc "Regenerates a rails 3 app for testing"
task :test_app do
require 'spree'
require 'generators/spree/test_app_generator'

# The generator wrecks our Gemfile and Gemfile.lock. Back them up and restore them when we're done
cp('Gemfile', 'Gemfile.real')
cp('Gemfile.lock', 'Gemfile.lock.real')

class StoreTestAppGenerator < Spree::Generators::TestAppGenerator

def install_gems
Expand All @@ -42,6 +47,10 @@ gem 'spree_related_products', :path => \'#{File.dirname(__FILE__)}\'

end
StoreTestAppGenerator.start
cp('Gemfile.real', 'Gemfile')
cp('Gemfile.lock.real', 'Gemfile.lock')
rm('Gemfile.real')
rm('Gemfile.lock.real')
end

namespace :test_app do
Expand Down

0 comments on commit e3b4dd9

Please sign in to comment.