diaspora_federation/spec/support/shared_parser_specs.rb

7 lines
249 B
Ruby

shared_examples ".parse parse error" do |reason, json|
it "raises error when #{reason}" do
expect {
json_parser.parse(JSON.parse(json))
}.to raise_error DiasporaFederation::Parsers::JsonParser::DeserializationError, reason
end
end