Permalink
Browse files

Generates a new Rails application in the template path before each

isolation test
  • Loading branch information...
1 parent 0e2078c commit 2450bd26df95ab76f9e24001ceab068b32df1c89 @LaAzteca LaAzteca committed Nov 29, 2012
Showing with 13 additions and 2 deletions.
  1. +13 −2 test/isolation/abstract_unit.rb
@@ -54,8 +54,9 @@ def build_app(options = {})
end
end
- unless options[:gemfile]
- File.delete "#{app_path}/Gemfile"
+ gemfile_path = "#{app_path}/Gemfile"
+ if options[:gemfile].blank? && File.exist?(gemfile_path)
+ File.delete gemfile_path
end
routes = File.read("#{app_path}/config/routes.rb")
@@ -106,3 +107,13 @@ class ActiveSupport::TestCase
include TestHelpers::Paths
include TestHelpers::Generation
end
+
+Module.new do
+ extend TestHelpers::Paths
+
+ # Build a rails app
+ FileUtils.rm_rf(app_template_path)
+ FileUtils.mkdir(app_template_path)
+
+ `rails new #{app_template_path} --skip-gemfile`
+end

0 comments on commit 2450bd2

Please sign in to comment.