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
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')