summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2015-01-26 22:45:23 -0800
committerAndre Arko <andre@arko.net>2015-01-26 22:47:20 -0800
commit7a03a32836a414c5cbc9af09f10335da1b628ebf (patch)
tree70b7a2a443e99fcb9de6e7361ddf7d9524ae2315 /spec
parentf187fd07fc0a14496708f55e3f710db22d9e9857 (diff)
downloadbundler-7a03a32836a414c5cbc9af09f10335da1b628ebf.tar.gz
add quoting tests from #3338
Diffstat (limited to 'spec')
-rw-r--r--spec/commands/config_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/commands/config_spec.rb b/spec/commands/config_spec.rb
index 292fe73799..6ecdc96753 100644
--- a/spec/commands/config_spec.rb
+++ b/spec/commands/config_spec.rb
@@ -230,6 +230,19 @@ E
# around some values, including $ and newlines.
expect(out).to include('BUNDLE_FOO: "$BUILD_DIR"')
end
+
+ it "doesn't duplicate quotes around long wrapped values" do
+ long_string = "--with-xml2-include=/usr/pkg/include/libxml2 --with-xml2-lib=/usr/pkg/lib --with-xslt-dir=/usr/pkg"
+ bundle "config foo #{long_string}"
+
+ run "puts Bundler.settings[:foo]"
+ expect(out).to eq(long_string)
+
+ bundle "config bar baz"
+
+ run "puts Bundler.settings[:foo]"
+ expect(out).to eq(long_string)
+ end
end
describe "very long lines" do
@@ -237,12 +250,21 @@ E
let(:long_string) do
"--with-xml2-include=/usr/pkg/include/libxml2 --with-xml2-lib=/usr/pkg/lib --with-xslt-dir=/usr/pkg"
end
+ let(:long_string_without_special_characters) do
+ "here is quite a long string that will wrap to a second line but will not be surrounded by quotes"
+ end
it "doesn't wrap values" do
bundle "config foo #{long_string}"
run "puts Bundler.settings[:foo]"
expect(out).to match(long_string)
end
+
+ it "can read wrapped unquoted values" do
+ bundle "config foo #{long_string_without_special_characters}"
+ run "puts Bundler.settings[:foo]"
+ expect(out).to match(long_string_without_special_characters)
+ end
end
end