summaryrefslogtreecommitdiff
path: root/spec/cache
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/cache
parent3fa809a13eeded67b1e8b3e421071f40c1f4b8f4 (diff)
downloadbundler-944a78293b0bc0f508a70ee99530d251297c5bcc.tar.gz
change to new expect syntax for rspec
Diffstat (limited to 'spec/cache')
-rw-r--r--spec/cache/gems_spec.rb48
-rw-r--r--spec/cache/git_spec.rb36
-rw-r--r--spec/cache/path_spec.rb22
-rw-r--r--spec/cache/platform_spec.rb12
4 files changed, 59 insertions, 59 deletions
diff --git a/spec/cache/gems_spec.rb b/spec/cache/gems_spec.rb
index 5270cd2411..8f4170146d 100644
--- a/spec/cache/gems_spec.rb
+++ b/spec/cache/gems_spec.rb
@@ -13,7 +13,7 @@ describe "bundle cache" do
end
it "copies the .gem file to vendor/cache" do
- bundled_app("vendor/cache/rack-1.0.0.gem").should exist
+ expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
end
it "uses the cache as a source when installing gems" do
@@ -70,7 +70,7 @@ describe "bundle cache" do
bundle "cache"
- bundled_app("Gemfile.lock").should exist
+ expect(bundled_app("Gemfile.lock")).to exist
end
end
@@ -102,7 +102,7 @@ describe "bundle cache" do
bundle :cache
- bundled_app("Gemfile.lock").should exist
+ expect(bundled_app("Gemfile.lock")).to exist
end
end
@@ -115,23 +115,23 @@ describe "bundle cache" do
gem "actionpack"
G
bundle :cache
- cached_gem("rack-1.0.0").should exist
- cached_gem("actionpack-2.3.2").should exist
- cached_gem("activesupport-2.3.2").should exist
+ expect(cached_gem("rack-1.0.0")).to exist
+ expect(cached_gem("actionpack-2.3.2")).to exist
+ expect(cached_gem("activesupport-2.3.2")).to exist
end
it "re-caches during install" do
cached_gem("rack-1.0.0").rmtree
bundle :install
- out.should include("Updating files in vendor/cache")
- cached_gem("rack-1.0.0").should exist
+ expect(out).to include("Updating files in vendor/cache")
+ expect(cached_gem("rack-1.0.0")).to exist
end
it "adds and removes when gems are updated" do
update_repo2
bundle 'update'
- cached_gem("rack-1.2").should exist
- cached_gem("rack-1.0.0").should_not exist
+ expect(cached_gem("rack-1.2")).to exist
+ expect(cached_gem("rack-1.0.0")).not_to exist
end
it "adds new gems and dependencies" do
@@ -139,8 +139,8 @@ describe "bundle cache" do
source "file://#{gem_repo2}"
gem "rails"
G
- cached_gem("rails-2.3.2").should exist
- cached_gem("activerecord-2.3.2").should exist
+ expect(cached_gem("rails-2.3.2")).to exist
+ expect(cached_gem("activerecord-2.3.2")).to exist
end
it "removes .gems for removed gems and dependencies" do
@@ -148,9 +148,9 @@ describe "bundle cache" do
source "file://#{gem_repo2}"
gem "rack"
G
- cached_gem("rack-1.0.0").should exist
- cached_gem("actionpack-2.3.2").should_not exist
- cached_gem("activesupport-2.3.2").should_not exist
+ expect(cached_gem("rack-1.0.0")).to exist
+ expect(cached_gem("actionpack-2.3.2")).not_to exist
+ expect(cached_gem("activesupport-2.3.2")).not_to exist
end
it "removes .gems when gem changes to git source" do
@@ -161,9 +161,9 @@ describe "bundle cache" do
gem "rack", :git => "#{lib_path("rack-1.0")}"
gem "actionpack"
G
- cached_gem("rack-1.0.0").should_not exist
- cached_gem("actionpack-2.3.2").should exist
- cached_gem("activesupport-2.3.2").should exist
+ expect(cached_gem("rack-1.0.0")).not_to exist
+ expect(cached_gem("actionpack-2.3.2")).to exist
+ expect(cached_gem("activesupport-2.3.2")).to exist
end
@@ -175,7 +175,7 @@ describe "bundle cache" do
G
bundle :cache
- cached_gem("platform_specific-1.0-java").should exist
+ expect(cached_gem("platform_specific-1.0-java")).to exist
end
simulate_new_machine
@@ -184,8 +184,8 @@ describe "bundle cache" do
gem "platform_specific"
G
- cached_gem("platform_specific-1.0-#{Gem::Platform.local}").should exist
- cached_gem("platform_specific-1.0-java").should exist
+ expect(cached_gem("platform_specific-1.0-#{Gem::Platform.local}")).to exist
+ expect(cached_gem("platform_specific-1.0-java")).to exist
end
it "doesn't remove gems with mismatched :rubygems_version or :date" do
@@ -196,7 +196,7 @@ describe "bundle cache" do
simulate_new_machine
bundle :install
- cached_gem("rack-1.0.0").should exist
+ expect(cached_gem("rack-1.0.0")).to exist
end
it "handles directories and non .gem files in the cache" do
@@ -212,7 +212,7 @@ describe "bundle cache" do
G
bundle "cache"
bundle "install"
- out.should_not =~ /removing/i
+ expect(out).not_to match(/removing/i)
end
it "does not warn about all if it doesn't have any git/path dependency" do
@@ -221,7 +221,7 @@ describe "bundle cache" do
gem "rack"
G
bundle "cache"
- out.should_not =~ /\-\-all/
+ expect(out).not_to match(/\-\-all/)
end
it "should install gems with the name bundler in them (that aren't bundler)" do
diff --git a/spec/cache/git_spec.rb b/spec/cache/git_spec.rb
index 480f847f22..b8aff44739 100644
--- a/spec/cache/git_spec.rb
+++ b/spec/cache/git_spec.rb
@@ -3,12 +3,12 @@ require "spec_helper"
describe "git base name" do
it "base_name should strip private repo uris" do
source = Bundler::Source::Git.new("uri" => "git@github.com:bundler.git")
- source.send(:base_name).should == "bundler"
+ expect(source.send(:base_name)).to eq("bundler")
end
it "base_name should strip network share paths" do
source = Bundler::Source::Git.new("uri" => "//MachineName/ShareFolder")
- source.send(:base_name).should == "ShareFolder"
+ expect(source.send(:base_name)).to eq("ShareFolder")
end
end
@@ -23,9 +23,9 @@ end
G
bundle "#{cmd} --all"
- bundled_app("vendor/cache/foo-1.0-#{ref}").should exist
- bundled_app("vendor/cache/foo-1.0-#{ref}/.git").should_not exist
- bundled_app("vendor/cache/foo-1.0-#{ref}/.bundlecache").should be_file
+ expect(bundled_app("vendor/cache/foo-1.0-#{ref}")).to exist
+ expect(bundled_app("vendor/cache/foo-1.0-#{ref}/.git")).not_to exist
+ expect(bundled_app("vendor/cache/foo-1.0-#{ref}/.bundlecache")).to be_file
FileUtils.rm_rf lib_path("foo-1.0")
should_be_installed "foo 1.0"
@@ -42,8 +42,8 @@ end
bundle "install --path vendor/bundle"
bundle "#{cmd} --all"
- bundled_app("vendor/cache/foo-1.0-#{ref}").should exist
- bundled_app("vendor/cache/foo-1.0-#{ref}/.git").should_not exist
+ expect(bundled_app("vendor/cache/foo-1.0-#{ref}")).to exist
+ expect(bundled_app("vendor/cache/foo-1.0-#{ref}/.git")).not_to exist
FileUtils.rm_rf lib_path("foo-1.0")
should_be_installed "foo 1.0"
@@ -59,7 +59,7 @@ end
bundle "#{cmd} --all"
bundle "#{cmd} --all"
- err.should == ""
+ expect(err).to eq("")
FileUtils.rm_rf lib_path("foo-1.0")
should_be_installed "foo 1.0"
end
@@ -79,17 +79,17 @@ end
end
ref = git.ref_for("master", 11)
- ref.should_not == old_ref
+ expect(ref).not_to eq(old_ref)
bundle "update"
bundle "#{cmd} --all"
- bundled_app("vendor/cache/foo-1.0-#{ref}").should exist
- bundled_app("vendor/cache/foo-1.0-#{old_ref}").should_not exist
+ expect(bundled_app("vendor/cache/foo-1.0-#{ref}")).to exist
+ expect(bundled_app("vendor/cache/foo-1.0-#{old_ref}")).not_to exist
FileUtils.rm_rf lib_path("foo-1.0")
run "require 'foo'"
- out.should == "CACHE"
+ expect(out).to eq("CACHE")
end
it "uses the local repository to generate the cache" do
@@ -104,7 +104,7 @@ end
bundle "install"
bundle "#{cmd} --all"
- bundled_app("vendor/cache/foo-invalid-#{ref}").should exist
+ expect(bundled_app("vendor/cache/foo-invalid-#{ref}")).to exist
# Updating the local still uses the local.
update_git "foo" do |s|
@@ -112,7 +112,7 @@ end
end
run "require 'foo'"
- out.should == "LOCAL"
+ expect(out).to eq("LOCAL")
end
it "copies repository to vendor cache, including submodules" do
@@ -136,8 +136,8 @@ end
ref = git.ref_for("master", 11)
bundle "#{cmd} --all"
- bundled_app("vendor/cache/has_submodule-1.0-#{ref}").should exist
- bundled_app("vendor/cache/has_submodule-1.0-#{ref}/submodule-1.0").should exist
+ expect(bundled_app("vendor/cache/has_submodule-1.0-#{ref}")).to exist
+ expect(bundled_app("vendor/cache/has_submodule-1.0-#{ref}/submodule-1.0")).to exist
should_be_installed "has_submodule 1.0"
end
@@ -150,7 +150,7 @@ end
bundle "#{cmd}"
- out.should include("Your Gemfile contains path and git dependencies.")
+ expect(out).to include("Your Gemfile contains path and git dependencies.")
end
it "does not display warning message if cache_all is set in bundle config" do
@@ -163,7 +163,7 @@ end
bundle "#{cmd} --all"
bundle "#{cmd}"
- out.should_not include("Your Gemfile contains path and git dependencies.")
+ expect(out).not_to include("Your Gemfile contains path and git dependencies.")
end
end
end
diff --git a/spec/cache/path_spec.rb b/spec/cache/path_spec.rb
index 94c451819a..324e1f131e 100644
--- a/spec/cache/path_spec.rb
+++ b/spec/cache/path_spec.rb
@@ -10,7 +10,7 @@ require "spec_helper"
G
bundle "#{cmd} --all"
- bundled_app("vendor/cache/foo-1.0").should_not exist
+ expect(bundled_app("vendor/cache/foo-1.0")).not_to exist
should_be_installed "foo 1.0"
end
@@ -22,8 +22,8 @@ require "spec_helper"
G
bundle "#{cmd} --all"
- bundled_app("vendor/cache/foo-1.0").should exist
- bundled_app("vendor/cache/foo-1.0/.bundlecache").should be_file
+ expect(bundled_app("vendor/cache/foo-1.0")).to exist
+ expect(bundled_app("vendor/cache/foo-1.0/.bundlecache")).to be_file
FileUtils.rm_rf lib_path("foo-1.0")
should_be_installed "foo 1.0"
@@ -44,11 +44,11 @@ require "spec_helper"
bundle "#{cmd} --all"
- bundled_app("vendor/cache/foo-1.0").should exist
+ expect(bundled_app("vendor/cache/foo-1.0")).to exist
FileUtils.rm_rf lib_path("foo-1.0")
run "require 'foo'"
- out.should == "CACHE"
+ expect(out).to eq("CACHE")
end
it "removes stale entries cache" do
@@ -65,7 +65,7 @@ require "spec_helper"
G
bundle "#{cmd} --all"
- bundled_app("vendor/cache/bar-1.0").should_not exist
+ expect(bundled_app("vendor/cache/bar-1.0")).not_to exist
end
it "raises a warning without --all" do
@@ -76,8 +76,8 @@ require "spec_helper"
G
bundle cmd
- out.should =~ /please pass the \-\-all flag/
- bundled_app("vendor/cache/foo-1.0").should_not exist
+ expect(out).to match(/please pass the \-\-all flag/)
+ expect(bundled_app("vendor/cache/foo-1.0")).not_to exist
end
it "stores the given flag" do
@@ -96,7 +96,7 @@ require "spec_helper"
G
bundle cmd
- bundled_app("vendor/cache/bar-1.0").should exist
+ expect(bundled_app("vendor/cache/bar-1.0")).to exist
end
it "can rewind chosen configuration" do
@@ -115,7 +115,7 @@ require "spec_helper"
G
bundle "#{cmd} --no-all"
- bundled_app("vendor/cache/baz-1.0").should_not exist
+ expect(bundled_app("vendor/cache/baz-1.0")).not_to exist
end
end
-end \ No newline at end of file
+end
diff --git a/spec/cache/platform_spec.rb b/spec/cache/platform_spec.rb
index 7e136640af..901f3db188 100644
--- a/spec/cache/platform_spec.rb
+++ b/spec/cache/platform_spec.rb
@@ -42,16 +42,16 @@ describe "bundle cache with multiple platforms" do
it "ensures that bundle install does not delete gems for other platforms" do
bundle "install"
- bundled_app("vendor/cache/rack-1.0.0.gem").should exist
- bundled_app("vendor/cache/activesupport-2.3.5.gem").should exist
- bundled_app("vendor/cache/activerecord-2.3.2.gem").should exist
+ expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
+ expect(bundled_app("vendor/cache/activesupport-2.3.5.gem")).to exist
+ expect(bundled_app("vendor/cache/activerecord-2.3.2.gem")).to exist
end
it "ensures that bundle update does not delete gems for other platforms" do
bundle "update"
- bundled_app("vendor/cache/rack-1.0.0.gem").should exist
- bundled_app("vendor/cache/activesupport-2.3.5.gem").should exist
- bundled_app("vendor/cache/activerecord-2.3.2.gem").should exist
+ expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
+ expect(bundled_app("vendor/cache/activesupport-2.3.5.gem")).to exist
+ expect(bundled_app("vendor/cache/activerecord-2.3.2.gem")).to exist
end
end