X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fdsa-puppet.git;a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Fspec%2Ffunctions%2Fparseyaml_spec.rb;h=62e18a324b98e35d2a7ef752911618b70bc54b8f;hp=e8d3f4ec1ce07bac0ec8d33720ad78110c678879;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hpb=6f656bd4265e3dab13b9af2bf96e9044322e9d8f diff --git a/3rdparty/modules/stdlib/spec/functions/parseyaml_spec.rb b/3rdparty/modules/stdlib/spec/functions/parseyaml_spec.rb index e8d3f4ec1..62e18a324 100644 --- a/3rdparty/modules/stdlib/spec/functions/parseyaml_spec.rb +++ b/3rdparty/modules/stdlib/spec/functions/parseyaml_spec.rb @@ -44,18 +44,9 @@ describe 'parseyaml' do end end - context 'on a modern ruby', :unless => RUBY_VERSION == '1.8.7' do - it 'raises an error with invalid YAML and no default' do - is_expected.to run.with_params('["one"') - .and_raise_error(Psych::SyntaxError) - end - end - - context 'when running on ruby 1.8.7, which does not have Psych', :if => RUBY_VERSION == '1.8.7' do - it 'raises an error with invalid YAML and no default' do - is_expected.to run.with_params('["one"') - .and_raise_error(ArgumentError) - end + it 'raises an error with invalid YAML and no default' do + is_expected.to run.with_params('["one"') + .and_raise_error(Psych::SyntaxError) end context 'with incorrect YAML data' do @@ -71,7 +62,7 @@ describe 'parseyaml' do end end - context 'when running on modern rubies', :unless => RUBY_VERSION == '1.8.7' do + context 'when running on modern rubies' do ['---', '...', '*8', ''].each do |value| it "should return the default value for an incorrect #{value.inspect} string parameter" do is_expected.to run.with_params(value, 'default_value')