Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ruby version check for bundle#pack

  • Loading branch information...
commit c30248257eb213578943cff58e1182ee1717eae7 1 parent eb2e9c0
@hone hone authored
Showing with 56 additions and 0 deletions.
  1. +56 −0 spec/other/ruby_spec.rb
View
56 spec/other/ruby_spec.rb
@@ -428,4 +428,60 @@ def should_be_engine_version_incorrect
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
Please sign in to comment.
Something went wrong with that request. Please try again.