spec/unit/parser_spec.rb in prawn-icon-2.4.0 vs spec/unit/parser_spec.rb in prawn-icon-2.5.0

- old
+ new

@@ -36,19 +36,21 @@ expect(formatted).to be_empty end it 'should raise an error when an icon key is invalid' do string = '<icon>an invalid key</icon>' - proc = Proc.new { Prawn::Icon::Parser.format(pdf, string) } - expect(proc).to raise_error(Prawn::Errors::UnknownFont) + expect { Prawn::Icon::Parser.format(pdf, string) }.to raise_error( + Prawn::Errors::UnknownFont + ) end it 'should raise an error when an icon is not found for valid set' do string = '<icon>far-__INVALID__</icon>' - proc = Proc.new { Prawn::Icon::Parser.format(pdf, string) } - expect(proc).to raise_error(Prawn::Icon::Errors::IconNotFound) + expect { Prawn::Icon::Parser.format(pdf, string) }.to raise_error( + Prawn::Icon::Errors::IconNotFound + ) end end describe '::config_from_tokens' do it 'should handle attrs with double quotes' do