diff options
Diffstat (limited to 'spec/unit/puppet/parser/functions')
-rw-r--r-- | spec/unit/puppet/parser/functions/validate_cmd_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/unit/puppet/parser/functions/validate_cmd_spec.rb b/spec/unit/puppet/parser/functions/validate_cmd_spec.rb index 69ea7f4..c0defbc 100644 --- a/spec/unit/puppet/parser/functions/validate_cmd_spec.rb +++ b/spec/unit/puppet/parser/functions/validate_cmd_spec.rb @@ -78,4 +78,12 @@ describe Puppet::Parser::Functions.function(:validate_cmd) do end end end + + it "can positively validate file content" do + expect { subject.call ["non-empty", "/usr/bin/test -s"] }.to_not raise_error + end + + it "can negatively validate file content" do + expect { subject.call ["", "/usr/bin/test -s"] }.to raise_error Puppet::ParseError, /failed to validate.*test -s/ + end end |