summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorCarl Lerche <carllerche@mac.com>2010-02-18 14:47:43 -0800
committerCarl Lerche <carllerche@mac.com>2010-02-18 14:47:43 -0800
commitd3c935acd0bfc11bd2c7635513abba1b1f0eb9e1 (patch)
tree4a5d3e54af9ff80d094c84e190af3466e423e29f /spec
parentd707bc5890b240ed351f10c5b02d716cbb25cf62 (diff)
downloadbundler-d3c935acd0bfc11bd2c7635513abba1b1f0eb9e1.tar.gz
bundle pack will cache and lock
Diffstat (limited to 'spec')
-rw-r--r--spec/cache/gems_spec.rb46
-rw-r--r--spec/cache/git_spec.rb (renamed from spec/pack/git_spec.rb)0
-rw-r--r--spec/pack/gems_spec.rb36
3 files changed, 52 insertions, 30 deletions
diff --git a/spec/cache/gems_spec.rb b/spec/cache/gems_spec.rb
new file mode 100644
index 0000000000..b477214f18
--- /dev/null
+++ b/spec/cache/gems_spec.rb
@@ -0,0 +1,46 @@
+require File.expand_path('../../spec_helper', __FILE__)
+
+describe "bundle cache with gems" do
+ describe "when there are only gemsources" do
+ before :each do
+ gemfile <<-G
+ gem 'rack'
+ G
+
+ system_gems "rack-1.0.0"
+ bundle :cache
+ end
+
+ it "copies the .gem file to vendor/cache" do
+ bundled_app("vendor/cache/rack-1.0.0.gem").should exist
+ end
+
+ it "uses the cache as a source when installing gems" do
+ system_gems []
+ bundle :install
+
+ should_be_installed("rack 1.0.0")
+ end
+ end
+
+ describe "when there are also git sources" do
+ it "still works" do
+ build_git "foo"
+ system_gems "rack-1.0.0"
+
+ install_gemfile <<-G
+ git "#{lib_path("foo-1.0")}"
+ gem 'rack'
+ gem 'foo'
+ G
+
+ bundle :cache
+
+ system_gems []
+ bundle :install
+
+ should_be_installed("rack 1.0.0", "foo 1.0")
+ end
+ end
+
+end \ No newline at end of file
diff --git a/spec/pack/git_spec.rb b/spec/cache/git_spec.rb
index e69de29bb2..e69de29bb2 100644
--- a/spec/pack/git_spec.rb
+++ b/spec/cache/git_spec.rb
diff --git a/spec/pack/gems_spec.rb b/spec/pack/gems_spec.rb
index b477214f18..13c87e4a7d 100644
--- a/spec/pack/gems_spec.rb
+++ b/spec/pack/gems_spec.rb
@@ -1,6 +1,6 @@
require File.expand_path('../../spec_helper', __FILE__)
-describe "bundle cache with gems" do
+describe "bundle pack with gems" do
describe "when there are only gemsources" do
before :each do
gemfile <<-G
@@ -8,39 +8,15 @@ describe "bundle cache with gems" do
G
system_gems "rack-1.0.0"
- bundle :cache
+ bundle :pack
end
- it "copies the .gem file to vendor/cache" do
- bundled_app("vendor/cache/rack-1.0.0.gem").should exist
- end
-
- it "uses the cache as a source when installing gems" do
- system_gems []
- bundle :install
-
- should_be_installed("rack 1.0.0")
+ it "locks the gemfile" do
+ bundled_app("Gemfile.lock").should exist
end
- end
-
- describe "when there are also git sources" do
- it "still works" do
- build_git "foo"
- system_gems "rack-1.0.0"
- install_gemfile <<-G
- git "#{lib_path("foo-1.0")}"
- gem 'rack'
- gem 'foo'
- G
-
- bundle :cache
-
- system_gems []
- bundle :install
-
- should_be_installed("rack 1.0.0", "foo 1.0")
+ it "caches the gems" do
+ bundled_app("vendor/cache/rack-1.0.0.gem").should exist
end
end
-
end \ No newline at end of file