diff options
author | Bryan Jen <bryan.jen@gmail.com> | 2015-09-21 11:20:35 -0700 |
---|---|---|
committer | Bryan Jen <bryan.jen@gmail.com> | 2015-09-21 11:20:35 -0700 |
commit | 97bd656efbd4ef70bb321f728e0f611fa931ad02 (patch) | |
tree | ca2f93dd6d459eac114f1e0b5cac05ac02d519cd /spec/acceptance/parsejson_spec.rb | |
parent | 9b1932c538354c1b360838c8cf7b942af314c99d (diff) | |
parent | 799c38e14e1583e676e2b25a9c1782fd40e29fff (diff) | |
download | puppet-stdlib-97bd656efbd4ef70bb321f728e0f611fa931ad02.tar.gz puppet-stdlib-97bd656efbd4ef70bb321f728e0f611fa931ad02.tar.bz2 |
Merge pull request #527 from mhaskel/511_compatibility
Fix backwards compatibility from #511
Diffstat (limited to 'spec/acceptance/parsejson_spec.rb')
-rwxr-xr-x | spec/acceptance/parsejson_spec.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/spec/acceptance/parsejson_spec.rb b/spec/acceptance/parsejson_spec.rb index d0feabd..d0e3de8 100755 --- a/spec/acceptance/parsejson_spec.rb +++ b/spec/acceptance/parsejson_spec.rb @@ -21,12 +21,24 @@ describe 'parsejson function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('o it 'raises error on incorrect json' do pp = <<-EOS $a = '{"hunter": "washere", "tests": "passing",}' - $ao = parsejson($a, {'tests' => 'using the default value'}) + $ao = parsejson($a, 'tests are using the default value') notice(inline_template('a is <%= @ao.inspect %>')) EOS apply_manifest(pp, :catch_failures => true) do |r| - expect(r.stdout).to match(/tests are "using the default value"/) + expect(r.stdout).to match(/tests are using the default value/) + end + end + + it 'raises error on incorrect json' do + pp = <<-EOS + $a = '{"hunter": "washere", "tests": "passing",}' + $ao = parsejson($a) + notice(inline_template('a is <%= @ao.inspect %>')) + EOS + + apply_manifest(pp, :expect_failures => true) do |r| + expect(r.stderr).to match(/expected next name/) end end |