Skip to content

Commit 3713bc8

Browse files
committed
Add unit test for new behavior
1 parent c8ea99e commit 3713bc8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
require 'spec_helper'
2+
3+
describe 'the "docker_run_flags" parser function' do
4+
let :scope do
5+
node = Puppet::Node.new('localhost')
6+
compiler = Puppet::Parser::Compiler.new(node)
7+
scope = Puppet::Parser::Scope.new(compiler)
8+
allow(scope).to receive(:environment).and_return(nil)
9+
scope
10+
end
11+
12+
it 'env with special chars' do
13+
expect(scope.function_docker_run_flags([{ 'env' => [%.MYSQL_PASSWORD='"$()[]{}<>.], 'extra_params' => [] }])).to match(/^-e MYSQL_PASSWORD\\=\\'\\"\\\$\\\(\\\)\\\[\\\]\\\{\\\}\\<\\> \\$/)
14+
end
15+
end

0 commit comments

Comments
 (0)