diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-06-27 20:34:47 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-06-27 20:34:47 -0500 |
commit | bc5f8817c167c3005ca8bc0930c1261d56af9f2e (patch) | |
tree | f3ac184f49671d6ee102eb52a9059ea24f9c3a32 | |
parent | 58fc66897b156ce91eb98710f7708f8abe36c806 (diff) | |
download | bundler-seg-ruby-head-specs.tar.gz |
[RubyVersion] Fix running when patch < 0seg-ruby-head-specs
-rw-r--r-- | lib/bundler/ruby_version.rb | 6 | ||||
-rw-r--r-- | spec/install/gemspecs_spec.rb | 8 |
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/bundler/ruby_version.rb b/lib/bundler/ruby_version.rb index d0e9c50af2..9321f94c23 100644 --- a/lib/bundler/ruby_version.rb +++ b/lib/bundler/ruby_version.rb @@ -42,7 +42,7 @@ module Bundler PATTERN = / ruby\s ([\d.]+) # ruby version - (?:p(\d+))? # optional patchlevel + (?:p(-?\d+))? # optional patchlevel (?:\s\((\S+)\s(.+)\))? # optional engine info /xo @@ -115,7 +115,9 @@ module Bundler else raise BundlerError, "RUBY_ENGINE value #{RUBY_ENGINE} is not recognized" end - @ruby_version ||= RubyVersion.new(ruby_version, RUBY_PATCHLEVEL.to_s, ruby_engine, ruby_engine_version) + patchlevel = RUBY_PATCHLEVEL.to_s + + @ruby_version ||= RubyVersion.new(ruby_version, patchlevel, ruby_engine, ruby_engine_version) end def to_gem_version_with_patchlevel diff --git a/spec/install/gemspecs_spec.rb b/spec/install/gemspecs_spec.rb index a9721b296b..aa3085b0d7 100644 --- a/spec/install/gemspecs_spec.rb +++ b/spec/install/gemspecs_spec.rb @@ -60,8 +60,8 @@ describe "bundle install" do should_be_installed "foo 1.0" end - it "installs when patch level is specified and the version still matches the current version" do - pending "this feature does not support dev ruby versions" if RUBY_PATCHLEVEL < 0 + it "installs when patch level is specified and the version still matches the current version", + :if => RUBY_PATCHLEVEL >= 0 do build_lib("foo", :path => bundled_app) do |s| s.required_ruby_version = "#{RUBY_VERSION}.#{RUBY_PATCHLEVEL}" end @@ -73,8 +73,8 @@ describe "bundle install" do should_be_installed "foo 1.0" end - it "fails and complains about patchlevel on patchlevel mismatch" do - pending "this feature does not support dev ruby versions" if RUBY_PATCHLEVEL < 0 + it "fails and complains about patchlevel on patchlevel mismatch", + :if => RUBY_PATCHLEVEL >= 0 do patchlevel = RUBY_PATCHLEVEL.to_i + 1 build_lib("foo", :path => bundled_app) do |s| s.required_ruby_version = "#{RUBY_VERSION}.#{patchlevel}" |