diff options
author | Bryan Kearney <bkearney@redhat.com> | 2009-02-18 12:46:17 -0500 |
---|---|---|
committer | Bryan Kearney <bkearney@redhat.com> | 2009-03-04 16:51:08 -0500 |
commit | cedeb7982b051e00173822c8d14a794e4fb10ae7 (patch) | |
tree | 1de584e184bad8b10f78abd41f8004f911100da6 /spec/unit | |
parent | cf48ec0aba120e6e83e48b3499df9029b5302767 (diff) | |
download | puppet-cedeb7982b051e00173822c8d14a794e4fb10ae7.tar.gz puppet-cedeb7982b051e00173822c8d14a794e4fb10ae7.tar.xz puppet-cedeb7982b051e00173822c8d14a794e4fb10ae7.zip |
Backport the fix for #1835
Diffstat (limited to 'spec/unit')
-rw-r--r-- | spec/unit/provider/augeas/augeas.rb | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/spec/unit/provider/augeas/augeas.rb b/spec/unit/provider/augeas/augeas.rb index 3ce64576e..e05812d78 100644 --- a/spec/unit/provider/augeas/augeas.rb +++ b/spec/unit/provider/augeas/augeas.rb @@ -54,6 +54,86 @@ describe provider_class do tokens[0][1].should == "/Jar/Jar" tokens[0][2].should == "Binks is my copilot" end + + it "should accept spaces and and single ticks" do + provider = provider_class.new() + tokens = provider.parse_commands("set 'Jar Jar' Binks") + tokens.size.should == 1 + tokens[0].size.should == 3 + tokens[0][0].should == "set" + tokens[0][1].should == "Jar Jar" + tokens[0][2].should == "Binks" + end + + it "should accept spaces in the value and and single ticks" do + provider = provider_class.new() + tokens = provider.parse_commands("set 'Jar Jar' 'Binks is my copilot'") + tokens.size.should == 1 + tokens[0].size.should == 3 + tokens[0][0].should == "set" + tokens[0][1].should == "Jar Jar" + tokens[0][2].should == "Binks is my copilot" + end + + it "should accept spaces and and double ticks" do + provider = provider_class.new() + tokens = provider.parse_commands('set "Jar Jar" Binks') + tokens.size.should == 1 + tokens[0].size.should == 3 + tokens[0][0].should == "set" + tokens[0][1].should == 'Jar Jar' + tokens[0][2].should == 'Binks' + end + + it "should accept spaces in the value and and double ticks" do + provider = provider_class.new() + tokens = provider.parse_commands('set "Jar Jar" "Binks is my copilot"') + tokens.size.should == 1 + tokens[0].size.should == 3 + tokens[0][0].should == "set" + tokens[0][1].should == 'Jar Jar' + tokens[0][2].should == 'Binks is my copilot' + end + + it "should accept mixed ticks" do + provider = provider_class.new() + tokens = provider.parse_commands('set "Jar Jar" "Some \'Test\'"') + tokens.size.should == 1 + tokens[0].size.should == 3 + tokens[0][0].should == "set" + tokens[0][1].should == 'Jar Jar' + tokens[0][2].should == "Some \'Test\'" + end + + it "should accept only the last value using ticks" do + provider = provider_class.new() + tokens = provider.parse_commands('set /Jar/Jar "Binks is my copilot"') + tokens.size.should == 1 + tokens[0].size.should == 3 + tokens[0][0].should == "set" + tokens[0][1].should == '/Jar/Jar' + tokens[0][2].should == "Binks is my copilot" + end + + it "should accept only the first value using ticks" do + provider = provider_class.new() + tokens = provider.parse_commands('set "Jar Jar" copilot') + tokens.size.should == 1 + tokens[0].size.should == 3 + tokens[0][0].should == "set" + tokens[0][1].should == 'Jar Jar' + tokens[0][2].should == "copilot" + end + + it "should accept only the first value using ticks and the last values being concatenated" do + provider = provider_class.new() + tokens = provider.parse_commands('set "Jar Jar" Binks is my copilot') + tokens.size.should == 1 + tokens[0].size.should == 3 + tokens[0][0].should == "set" + tokens[0][1].should == 'Jar Jar' + tokens[0][2].should == "Binks is my copilot" + end end describe "get filters" do |