diff options
author | Tim Smith <tsmith@chef.io> | 2017-12-21 09:49:42 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-21 09:49:42 -0800 |
commit | 71a596ec29d98030653f83dc13221593cc80d948 (patch) | |
tree | 2ab67d5dd38df679d374847c56429618ee09d750 /spec/unit | |
parent | 8980bb3847c2bc9dd511bd8923066718b57217d2 (diff) | |
parent | 9f02a591acb6eeb99712c4c24beb653ddd528a5f (diff) | |
download | chef-71a596ec29d98030653f83dc13221593cc80d948.tar.gz |
Merge pull request #6695 from bloomberg/bootstrap-strings
Escape single-quoted strings from the context in knife bootstrap
Diffstat (limited to 'spec/unit')
-rw-r--r-- | spec/unit/knife/bootstrap_spec.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/unit/knife/bootstrap_spec.rb b/spec/unit/knife/bootstrap_spec.rb index 736ff9b099..c725526de7 100644 --- a/spec/unit/knife/bootstrap_spec.rb +++ b/spec/unit/knife/bootstrap_spec.rb @@ -516,6 +516,11 @@ describe Chef::Knife::Bootstrap do end context "a flat directory structure" do + it "escapes single-quotes" do + expect(rendered_template).to match("cat > /etc/chef/client.d/02-strings.rb <<'EOP'") + expect(rendered_template).to match("something '\\\\''/foo/bar'\\\\''") + end + it "creates a file 00-foo.rb" do expect(rendered_template).to match("cat > /etc/chef/client.d/00-foo.rb <<'EOP'") expect(rendered_template).to match("d6f9b976-289c-4149-baf7-81e6ffecf228") |