summaryrefslogtreecommitdiff
path: root/spec/other
diff options
context:
space:
mode:
authorTerence Lee <hone02@gmail.com>2012-04-22 10:59:06 -0500
committerTerence Lee <hone02@gmail.com>2012-05-03 16:26:04 -0700
commitc30248257eb213578943cff58e1182ee1717eae7 (patch)
tree70e61af66a6b15322702b1581536e9b0ace2712f /spec/other
parenteb2e9c01e6054563ba31109cd543dca7a6358f35 (diff)
downloadbundler-c30248257eb213578943cff58e1182ee1717eae7.tar.gz
ruby version check for bundle#pack
Diffstat (limited to 'spec/other')
-rw-r--r--spec/other/ruby_spec.rb56
1 files changed, 56 insertions, 0 deletions
diff --git a/spec/other/ruby_spec.rb b/spec/other/ruby_spec.rb
index 6cefd15b56..ef3237a9c5 100644
--- a/spec/other/ruby_spec.rb
+++ b/spec/other/ruby_spec.rb
@@ -428,4 +428,60 @@ describe "bundle ruby" do
end
end
end
+
+ context "bundle pack" do
+ before do
+ gemfile <<-G
+ gem 'rack'
+ G
+
+ system_gems "rack-1.0.0"
+ end
+
+ it "copies the .gem file to vendor/cache when ruby version matches" do
+ gemfile <<-G
+ gem 'rack'
+
+ #{ruby_version_correct}
+ G
+
+ bundle :pack
+ bundled_app("vendor/cache/rack-1.0.0.gem").should exist
+ end
+
+ it "fails if the ruby version doesn't match" do
+ gemfile <<-G
+ gem 'rack'
+
+ #{ruby_version_incorrect}
+ G
+
+ bundle :pack, :exitstatus => true
+ should_be_ruby_version_incorrect
+ end
+
+ it "fails if the engine doesn't match" do
+ gemfile <<-G
+ gem 'rack'
+
+ #{engine_incorrect}
+ G
+
+ bundle :pack, :exitstatus => true
+ should_be_engine_incorrect
+ end
+
+ it "fails if the engine version doesn't match" do
+ simulate_ruby_engine "jruby" do
+ gemfile <<-G
+ gem 'rack'
+
+ #{engine_version_incorrect}
+ G
+
+ bundle :pack, :exitstatus => true
+ should_be_engine_version_incorrect
+ end
+ end
+ end
end