1 #! /usr/bin/env ruby -S rspec
2 require 'spec_helper_acceptance'
4 describe 'parsejson function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
6 it 'parses valid json' do
8 $a = '{"hunter": "washere", "tests": "passing"}'
11 notice(inline_template('tests are <%= @tests.inspect %>'))
14 apply_manifest(pp, :catch_failures => true) do |r|
15 expect(r.stdout).to match(/tests are "passing"/)
20 it 'raises error on incorrect json' do
22 $a = '{"hunter": "washere", "tests": "passing",}'
24 notice(inline_template('a is <%= @ao.inspect %>'))
27 apply_manifest(pp, :expect_failures => true) do |r|
28 expect(r.stderr).to match(/expected next name/)
32 it 'raises error on incorrect number of arguments'