Skip to content

Commit 770b2b1

Browse files
committedAug 3, 2015
Merge pull request #418 from grosser/grosser/speed2
move gem instead of uninstalling and reinstalling to make test go fro…
2 parents e2dd326 + e60311f commit 770b2b1

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed
 

‎lib/spring/test/acceptance_test.rb

+9-4
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ def assert_speedup(ratio = DEFAULT_SPEEDUP)
5858
end
5959
end
6060

61+
def without_gem(name)
62+
gem_home = app.gem_home.join('gems')
63+
FileUtils.mv(gem_home.join(name), app.root)
64+
yield
65+
ensure
66+
FileUtils.mv(app.root.join(name), gem_home)
67+
end
68+
6169
setup do
6270
generator.generate_if_missing
6371
generator.install_spring
@@ -193,12 +201,9 @@ def exec_name
193201
end
194202

195203
test "binstub when spring is uninstalled" do
196-
begin
197-
app.run! "gem uninstall --ignore-dependencies spring"
204+
without_gem "spring-#{Spring::VERSION}" do
198205
File.write(app.gemfile, app.gemfile.read.gsub(/gem 'spring.*/, ""))
199206
assert_success "bin/rake -T", stdout: "rake db:migrate"
200-
ensure
201-
generator.build_and_install_gems
202207
end
203208
end
204209

0 commit comments

Comments
 (0)
Please sign in to comment.