summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2015-01-26 22:45:23 -0800
committerAndre Arko <andre@arko.net>2015-03-30 17:10:16 +0100
commit98cc5eb39da89320dd69057670efdd9e6abcd82c (patch)
tree22bbf3105251bbe4ab3919c93f257f3ddf73da91
parent62430f9aabdcb68bc05759918bfbc476066c70b4 (diff)
downloadbundler-98cc5eb39da89320dd69057670efdd9e6abcd82c.tar.gz
add quoting tests from #3338
-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 208af617df..8d50a0a5c0 100644
--- a/spec/commands/config_spec.rb
+++ b/spec/commands/config_spec.rb
@@ -223,6 +223,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
@@ -230,12 +243,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