aboutsummaryrefslogtreecommitdiffstats
path: root/spec/other/clean_spec.rb
diff options
context:
space:
mode:
authorTerence Lee <hone02@gmail.com>2012-10-09 16:50:55 -1000
committerTerence Lee <hone02@gmail.com>2012-10-09 16:51:54 -1000
commit944a78293b0bc0f508a70ee99530d251297c5bcc (patch)
tree241595f7f787339e934b1c89cda83a287faa1c3b /spec/other/clean_spec.rb
parent3fa809a13eeded67b1e8b3e421071f40c1f4b8f4 (diff)
downloadbundler-944a78293b0bc0f508a70ee99530d251297c5bcc.tar.gz
change to new expect syntax for rspec
Diffstat (limited to 'spec/other/clean_spec.rb')
-rw-r--r--spec/other/clean_spec.rb88
1 files changed, 44 insertions, 44 deletions
diff --git a/spec/other/clean_spec.rb b/spec/other/clean_spec.rb
index 5a481609..8b93f9a7 100644
--- a/spec/other/clean_spec.rb
+++ b/spec/other/clean_spec.rb
@@ -3,17 +3,17 @@ require "spec_helper"
describe "bundle clean" do
def should_have_gems(*gems)
gems.each do |g|
- vendored_gems("gems/#{g}").should exist
- vendored_gems("specifications/#{g}.gemspec").should exist
- vendored_gems("cache/#{g}.gem").should exist
+ expect(vendored_gems("gems/#{g}")).to exist
+ expect(vendored_gems("specifications/#{g}.gemspec")).to exist
+ expect(vendored_gems("cache/#{g}.gem")).to exist
end
end
def should_not_have_gems(*gems)
gems.each do |g|
- vendored_gems("gems/#{g}").should_not exist
- vendored_gems("specifications/#{g}.gemspec").should_not exist
- vendored_gems("cache/#{g}.gem").should_not exist
+ expect(vendored_gems("gems/#{g}")).not_to exist
+ expect(vendored_gems("specifications/#{g}.gemspec")).not_to exist
+ expect(vendored_gems("cache/#{g}.gem")).not_to exist
end
end
@@ -36,12 +36,12 @@ describe "bundle clean" do
bundle :clean
- out.should eq("Removing foo (1.0)")
+ expect(out).to eq("Removing foo (1.0)")
should_have_gems 'thin-1.0', 'rack-1.0.0'
should_not_have_gems 'foo-1.0'
- vendored_gems("bin/rackup").should exist
+ expect(vendored_gems("bin/rackup")).to exist
end
it "removes old version of gem if unused" do
@@ -64,12 +64,12 @@ describe "bundle clean" do
bundle :clean
- out.should eq("Removing rack (0.9.1)")
+ expect(out).to eq("Removing rack (0.9.1)")
should_have_gems 'foo-1.0', 'rack-1.0.0'
should_not_have_gems 'rack-0.9.1'
- vendored_gems("bin/rackup").should exist
+ expect(vendored_gems("bin/rackup")).to exist
end
it "removes new version of gem if unused" do
@@ -92,12 +92,12 @@ describe "bundle clean" do
bundle :clean
- out.should eq("Removing rack (1.0.0)")
+ expect(out).to eq("Removing rack (1.0.0)")
should_have_gems 'foo-1.0', 'rack-0.9.1'
should_not_have_gems 'rack-1.0.0'
- vendored_gems("bin/rackup").should exist
+ expect(vendored_gems("bin/rackup")).to exist
end
it "does not remove cached git dir if it's being used" do
@@ -119,7 +119,7 @@ describe "bundle clean" do
bundle :clean
digest = Digest::SHA1.hexdigest(git_path.to_s)
- vendored_gems("cache/bundler/git/foo-1.0-#{digest}").should exist
+ expect(vendored_gems("cache/bundler/git/foo-1.0-#{digest}")).to exist
end
it "removes unused git gems" do
@@ -147,16 +147,16 @@ describe "bundle clean" do
bundle :clean
- out.should eq("Removing foo (#{revision[0..11]})")
+ expect(out).to eq("Removing foo (#{revision[0..11]})")
- vendored_gems("gems/rack-1.0.0").should exist
- vendored_gems("bundler/gems/foo-#{revision[0..11]}").should_not exist
+ expect(vendored_gems("gems/rack-1.0.0")).to exist
+ expect(vendored_gems("bundler/gems/foo-#{revision[0..11]}")).not_to exist
digest = Digest::SHA1.hexdigest(git_path.to_s)
- vendored_gems("cache/bundler/git/foo-#{digest}").should_not exist
+ expect(vendored_gems("cache/bundler/git/foo-#{digest}")).not_to exist
- vendored_gems("specifications/rack-1.0.0.gemspec").should exist
+ expect(vendored_gems("specifications/rack-1.0.0.gemspec")).to exist
- vendored_gems("bin/rackup").should exist
+ expect(vendored_gems("bin/rackup")).to exist
end
it "removes old git gems" do
@@ -180,15 +180,15 @@ describe "bundle clean" do
bundle "update"
bundle :clean
- out.should eq("Removing foo-bar (#{revision[0..11]})")
+ expect(out).to eq("Removing foo-bar (#{revision[0..11]})")
- vendored_gems("gems/rack-1.0.0").should exist
- vendored_gems("bundler/gems/foo-bar-#{revision[0..11]}").should_not exist
- vendored_gems("bundler/gems/foo-bar-#{revision2[0..11]}").should exist
+ expect(vendored_gems("gems/rack-1.0.0")).to exist
+ expect(vendored_gems("bundler/gems/foo-bar-#{revision[0..11]}")).not_to exist
+ expect(vendored_gems("bundler/gems/foo-bar-#{revision2[0..11]}")).to exist
- vendored_gems("specifications/rack-1.0.0.gemspec").should exist
+ expect(vendored_gems("specifications/rack-1.0.0.gemspec")).to exist
- vendored_gems("bin/rackup").should exist
+ expect(vendored_gems("bin/rackup")).to exist
end
it "does not remove nested gems in a git repo" do
@@ -204,9 +204,9 @@ describe "bundle clean" do
bundle "install --path vendor/bundle"
bundle :clean
- out.should eq("")
+ expect(out).to eq("")
- vendored_gems("bundler/gems/rails-#{revision[0..11]}").should exist
+ expect(vendored_gems("bundler/gems/rails-#{revision[0..11]}")).to exist
end
it "does not remove git sources that are in without groups" do
@@ -228,10 +228,10 @@ describe "bundle clean" do
bundle :clean
- out.should eq("")
- vendored_gems("bundler/gems/foo-#{revision[0..11]}").should exist
+ expect(out).to eq("")
+ expect(vendored_gems("bundler/gems/foo-#{revision[0..11]}")).to exist
digest = Digest::SHA1.hexdigest(git_path.to_s)
- vendored_gems("cache/bundler/git/foo-#{digest}").should exist
+ expect(vendored_gems("cache/bundler/git/foo-#{digest}")).to exist
end
it "displays an error when used without --path" do
@@ -243,8 +243,8 @@ describe "bundle clean" do
bundle :clean, :exitstatus => true
- exitstatus.should eq(1)
- out.should == "Can only use bundle clean when --path is set or --force is set"
+ expect(exitstatus).to eq(1)
+ expect(out).to eq("Can only use bundle clean when --path is set or --force is set")
end
# handling bundle clean upgrade path from the pre's
@@ -274,7 +274,7 @@ describe "bundle clean" do
should_not_have_gems 'thin-1.0', 'rack-1.0'
should_have_gems 'foo-1.0'
- vendored_gems("bin/rackup").should_not exist
+ expect(vendored_gems("bin/rackup")).not_to exist
end
it "does not call clean automatically when using system gems" do
@@ -294,8 +294,8 @@ describe "bundle clean" do
bundle :install
sys_exec "gem list"
- out.should include("rack (1.0.0)")
- out.should include("thin (1.0)")
+ expect(out).to include("rack (1.0.0)")
+ expect(out).to include("thin (1.0)")
end
it "--clean should override the bundle setting on install" do
@@ -391,7 +391,7 @@ describe "bundle clean" do
bundle :update
sys_exec "gem list"
- out.should include("foo (1.0.1, 1.0)")
+ expect(out).to include("foo (1.0.1, 1.0)")
end
it "cleans system gems when --force is used" do
@@ -411,10 +411,10 @@ describe "bundle clean" do
bundle :install
bundle "clean --force"
- out.should eq("Removing foo (1.0)")
+ expect(out).to eq("Removing foo (1.0)")
sys_exec "gem list"
- out.should_not include("foo (1.0)")
- out.should include("rack (1.0.0)")
+ expect(out).not_to include("foo (1.0)")
+ expect(out).to include("rack (1.0.0)")
end
it "cleans git gems with a 7 length git revision" do
@@ -442,9 +442,9 @@ describe "bundle clean" do
bundle :clean
- out.should_not include("Removing foo (1.0 #{revision[0..6]})")
+ expect(out).not_to include("Removing foo (1.0 #{revision[0..6]})")
- vendored_gems("bundler/gems/foo-1.0-#{revision[0..6]}").should exist
+ expect(vendored_gems("bundler/gems/foo-1.0-#{revision[0..6]}")).to exist
end
it "when using --force on system gems, it doesn't remove binaries" do
@@ -467,8 +467,8 @@ describe "bundle clean" do
sys_status "foo"
- exitstatus.should eq(0)
- out.should eq("1.0")
+ expect(exitstatus).to eq(0)
+ expect(out).to eq("1.0")
end
it "doesn't blow up on path gems without a .gempsec" do
@@ -489,6 +489,6 @@ describe "bundle clean" do
bundle "install --path vendor/bundle"
bundle :clean, :exitstatus => true
- exitstatus.should eq(0)
+ expect(exitstatus).to eq(0)
end
end