Rakefile in rabl-0.8.1 vs Rakefile in rabl-0.8.2
- old
+ new
@@ -12,36 +12,40 @@
test.ruby_opts = ['-rubygems']
end
# Running integration tests
# rake test:clean
-# rake test:stup
+# rake test:setup
# rake test:full
fixture_list = "{padrino_test,sinatra_test,rails2,rails3,rails3_2}"
desc "Clean up the fixtures being tested by cleaning and installing dependencies"
task "test:clean" do
Dir[File.dirname(__FILE__) + "/fixtures/#{fixture_list}"].each do |fixture|
puts "\n*** Cleaning up for #{File.basename(fixture)} tests ***\n"
- puts `cd #{fixture}; rm Gemfile.lock`
+ Dir.chdir(fixture) { puts `rm Gemfile.lock` }
end
end
desc "Prepares the fixtures being tested by installing dependencies"
task "test:setup" do
Dir[File.dirname(__FILE__) + "/fixtures/#{fixture_list}"].each do |fixture|
puts "\n*** Setting up for #{File.basename(fixture)} tests ***\n"
- `export BUNDLE_GEMFILE=#{fixture}/Gemfile` if ENV['TRAVIS']
- puts `cd #{fixture}; mkdir -p tmp/cache; bundle install;`
+ `export BUNDLE_GEMFILE="#{fixture}/Gemfile"` if ENV["TRAVIS"]
+ Bundler.with_clean_env {
+ Dir.chdir(fixture) { puts `mkdir -p tmp/cache; bundle install --gemfile="#{fixture}/Gemfile"`; }
+ }
end
end
desc "Executes the fixture tests"
task "test:fixtures" do
Dir[File.dirname(__FILE__) + "/fixtures/#{fixture_list}"].each do |fixture|
puts "\n*** Running tests for #{File.basename(fixture)}... ***\n"
- puts `cd #{fixture}; bundle check; bundle exec rake test:rabl`
+ Bundler.with_clean_env {
+ Dir.chdir(fixture) { puts `bundle check; bundle exec rake test:rabl` }
+ }
end
end
task "test:full" => [:test, "test:fixtures"]
\ No newline at end of file