From 799c38e14e1583e676e2b25a9c1782fd40e29fff Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Mon, 21 Sep 2015 10:56:08 -0700 Subject: Fix backwards compatibility from #511 Maintain the old behavior in the case where the optional second parameter isn't passed. Also, adding arity is backwards incompatible since stdlib still supports 2.7, so remove that. --- spec/functions/parsejson_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'spec/functions/parsejson_spec.rb') diff --git a/spec/functions/parsejson_spec.rb b/spec/functions/parsejson_spec.rb index 5bea8af..a01f1f6 100755 --- a/spec/functions/parsejson_spec.rb +++ b/spec/functions/parsejson_spec.rb @@ -41,10 +41,10 @@ describe 'parsejson' do end - context 'with incorrect YAML data' do - it 'should return "nil" if a default value should be returned but is not provided' do + context 'with incorrect JSON data' do + it 'should raise an error with invalid JSON and no default' do is_expected.to run.with_params(''). - and_return(nil) + and_raise_error(PSON::ParserError) end it 'should support a structure for a default value' do -- cgit v1.2.3