Skip to content

Commit

Permalink
Merge pull request #418 from grosser/grosser/speed2
Browse files Browse the repository at this point in the history
move gem instead of uninstalling and reinstalling to make test go fro…
  • Loading branch information
grosser committed Aug 3, 2015
2 parents e2dd326 + e60311f commit 770b2b1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/spring/test/acceptance_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ def assert_speedup(ratio = DEFAULT_SPEEDUP)
end
end

def without_gem(name)
gem_home = app.gem_home.join('gems')
FileUtils.mv(gem_home.join(name), app.root)
yield
ensure
FileUtils.mv(app.root.join(name), gem_home)
end

setup do
generator.generate_if_missing
generator.install_spring
Expand Down Expand Up @@ -193,12 +201,9 @@ def exec_name
end

test "binstub when spring is uninstalled" do
begin
app.run! "gem uninstall --ignore-dependencies spring"
without_gem "spring-#{Spring::VERSION}" do
File.write(app.gemfile, app.gemfile.read.gsub(/gem 'spring.*/, ""))
assert_success "bin/rake -T", stdout: "rake db:migrate"
ensure
generator.build_and_install_gems
end
end

Expand Down

0 comments on commit 770b2b1

Please sign in to comment.