diff options
author | Andre Arko <andre@arko.net> | 2015-06-23 22:30:42 -0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2015-06-23 22:30:43 -0700 |
commit | 239d01df6d43cd4e9e333a18faf59d9c3e5e46c3 (patch) | |
tree | b5d9a0a229554fc6f9ee9893a864764f4938b672 | |
parent | 3b7045a285a03fb6e36704b988304ee089b12d0a (diff) | |
download | bundler-239d01df6d43cd4e9e333a18faf59d9c3e5e46c3.tar.gz |
expect the correct exitstatus, refactor tests
-rw-r--r-- | spec/install/force_spec.rb | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/spec/install/force_spec.rb b/spec/install/force_spec.rb index fd695bdc0b..737c11d923 100644 --- a/spec/install/force_spec.rb +++ b/spec/install/force_spec.rb @@ -10,37 +10,27 @@ describe "bundle install" do end it "re-installs installed gems" do + rack_lib = default_bundle_path("gems/rack-1.0.0/lib/rack.rb") + bundle "install" + rack_lib.open('w'){|f| f.write("blah blah blah") } bundle "install --force" + expect(exitstatus).to eq(0) if exitstatus + expect(out).to include "Using bundler" expect(out).to include "Installing rack 1.0.0" + expect(rack_lib.open{|f| f.read }).to eq("RACK = '1.0.0'\n") should_be_installed "rack 1.0.0" - expect(exitstatus).to eq(0) if exitstatus - end - - it "overwrites old gem code" do - bundle "install" - default_bundle_path("gems/rack-1.0.0/lib/rack.rb").open('w'){|f| f.write("blah blah blah") } - bundle "install --force" - - expect(default_bundle_path("gems/rack-1.0.0/lib/rack.rb").open{|f| f.read }).to eq("RACK = '1.0.0'\n") - end - - it "doesn't reinstall bundler" do - bundle "install" - bundle "install --force" - expect(out).to_not include "Installing bundler 1.10.4" - expect(out).to include "Using bundler 1.10.4" end it "works on first bundle install" do bundle "install --force" + expect(exitstatus).to eq(0) if exitstatus + expect(out).to include "Using bundler" expect(out).to include "Installing rack 1.0.0" should_be_installed "rack 1.0.0" - expect(exitstatus).to eq(0) if exitstatus end - end end |