summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2014-11-19 20:07:43 -0800
committerAndre Arko <andre@arko.net>2014-11-19 20:08:01 -0800
commit481a51805670d408445a39ded6117d808484c374 (patch)
treea2a1a1e16d1ed60410b59bbb6702dd2d2c150e3c
parent19f9e6d361ca1124c3e38035819727ac9b60230e (diff)
downloadbundler-481a51805670d408445a39ded6117d808484c374.tar.gz
limit quote-doubling spec to 2.1
YAML only adds quotes to values starting in Ruby 2.1, so testing this on earlier versions of Ruby seems silly.
-rw-r--r--spec/commands/config_spec.rb5
-rw-r--r--spec/spec_helper.rb8
2 files changed, 12 insertions, 1 deletions
diff --git a/spec/commands/config_spec.rb b/spec/commands/config_spec.rb
index e770dd8927..e0e0646ce8 100644
--- a/spec/commands/config_spec.rb
+++ b/spec/commands/config_spec.rb
@@ -210,7 +210,7 @@ E
expect(out).to eq("1")
end
- it "doesn't duplicate quotes around values" do
+ it "doesn't duplicate quotes around values", :ruby => "2.1" do
bundled_app(".bundle").mkpath
File.open(bundled_app(".bundle/config"), 'w') do |f|
f.write 'BUNDLE_FOO: "$BUILD_DIR"'
@@ -218,6 +218,9 @@ E
expect(bundled_app(".bundle/config").read).to eq('BUNDLE_FOO: "$BUILD_DIR"')
bundle :install, :jobs => 4
run "puts Bundler.settings.send(:local_config_file).read"
+
+ # Starting in Ruby 2.1, YAML automatically adds double quotes
+ # around some values, including $ and newlines.
expect(out).to include('BUNDLE_FOO: "$BUILD_DIR"')
end
end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index e55a72bcf0..1396dc6921 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -72,6 +72,14 @@ RSpec.configure do |config|
config.filter_run_excluding :ruby => "2.1"
end
+ if RUBY_VERSION >= "2.1"
+ config.filter_run_excluding :ruby => "1.8"
+ config.filter_run_excluding :ruby => "1.9"
+ config.filter_run_excluding :ruby => "2.0"
+ else
+ config.filter_run_excluding :ruby => "2.1"
+ end
+
if Gem::VERSION < "2.2"
config.filter_run_excluding :rubygems => "2.2"
end