summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2015-05-10 20:51:12 -0700
committerAndre Arko <andre@arko.net>2015-05-11 13:08:46 -0700
commitd459b23a45daee42c53bd2ad3c3e364bab857b28 (patch)
treeab4c909ddc600a2c2eb9390793ba8f9d42e40541
parent475bb73db2d843bf1d5a8d8e9331b25722429dcf (diff)
downloadbundler-d459b23a45daee42c53bd2ad3c3e364bab857b28.tar.gz
run 1.8 specs only on 1.8.x, etc
-rw-r--r--spec/realworld/edgecases_spec.rb6
-rw-r--r--spec/support/less_than_proc.rb13
2 files changed, 12 insertions, 7 deletions
diff --git a/spec/realworld/edgecases_spec.rb b/spec/realworld/edgecases_spec.rb
index 15c7697564..85c6784fe4 100644
--- a/spec/realworld/edgecases_spec.rb
+++ b/spec/realworld/edgecases_spec.rb
@@ -2,7 +2,7 @@ require 'spec_helper'
describe "real world edgecases", :realworld => true do
# there is no rbx-relative-require gem that will install on 1.9
- it "ignores extra gems with bad platforms", :ruby => "1.8" do
+ it "ignores extra gems with bad platforms", :ruby => "~> 1.8" do
install_gemfile <<-G
source :rubygems
gem "linecache", "0.46"
@@ -11,7 +11,7 @@ describe "real world edgecases", :realworld => true do
end
# https://github.com/bundler/bundler/issues/1202
- it "bundle cache works with rubygems 1.3.7 and pre gems", :ruby => "1.8" do
+ it "bundle cache works with rubygems 1.3.7 and pre gems", :ruby => "~> 1.8" do
install_gemfile <<-G
source :rubygems
gem "rack", "1.3.0.beta2"
@@ -23,7 +23,7 @@ describe "real world edgecases", :realworld => true do
# https://github.com/bundler/bundler/issues/1486
# this is a hash collision that only manifests on 1.8.7
- it "finds the correct child versions", :ruby => "1.8" do
+ it "finds the correct child versions", :ruby => "~> 1.8" do
install_gemfile <<-G
source :rubygems
diff --git a/spec/support/less_than_proc.rb b/spec/support/less_than_proc.rb
index af80d82c4e..ac6193ef59 100644
--- a/spec/support/less_than_proc.rb
+++ b/spec/support/less_than_proc.rb
@@ -2,10 +2,15 @@ class LessThanProc < Proc
attr_accessor :present
def self.with(present)
- pv = Gem::Version.new(present.dup)
- lt = self.new { |required| pv < Gem::Version.new(required) }
- lt.present = present
- return lt
+ provided = Gem::Version.new(present.dup)
+
+ self.new do |required|
+ if required.scan(/[=><~]/)
+ !Gem::Requirement.new(required).satisfied_by?(provided)
+ else
+ provided < Gem::Version.new(required)
+ end
+ end.tap{|l| l.present = present }
end
def inspect