Skip to content

move gem instead of uninstalling and reinstalling to make test go fro… #418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 3, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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