spec/prawn/svg/loaders/data_spec.rb in prawn-svg-0.34.2 vs spec/prawn/svg/loaders/data_spec.rb in prawn-svg-0.35.0

- old
+ new

@@ -3,61 +3,61 @@ RSpec.describe Prawn::SVG::Loaders::Data do let(:uri) { URI(url) } subject { Prawn::SVG::Loaders::Data.new.from_url(url) } - context "with a valid image/png data URL" do - let(:url) { "data:image/png;base64,aGVsbG8=" } + context 'with a valid image/png data URL' do + let(:url) { 'data:image/png;base64,aGVsbG8=' } - it "loads the data" do - expect(subject).to eq "hello" + it 'loads the data' do + expect(subject).to eq 'hello' end end - context "with a valid image/jpeg data URL" do - let(:url) { "data:image/jpeg;base64,aGVsbG8=" } + context 'with a valid image/jpeg data URL' do + let(:url) { 'data:image/jpeg;base64,aGVsbG8=' } - it "loads the data" do - expect(subject).to eq "hello" + it 'loads the data' do + expect(subject).to eq 'hello' end end - context "with a data URL that has extra metadata" do - let(:url) { "data:image/png;base64;metadata;here,aGVsbG8=" } + context 'with a data URL that has extra metadata' do + let(:url) { 'data:image/png;base64;metadata;here,aGVsbG8=' } - it "loads the data" do - expect(subject).to eq "hello" + it 'loads the data' do + expect(subject).to eq 'hello' end end context "with a data URL that's uppercase" do - let(:url) { "DATA:IMAGE/PNG;BASE64;METADATA;HERE,aGVsbG8=" } + let(:url) { 'DATA:IMAGE/PNG;BASE64;METADATA;HERE,aGVsbG8=' } - it "loads the data" do - expect(subject).to eq "hello" + it 'loads the data' do + expect(subject).to eq 'hello' end end context "with a URL that's not a data scheme" do - let(:url) { "http://some.host" } + let(:url) { 'http://some.host' } - it "returns nil" do + it 'returns nil' do expect(subject).to be nil end end context "with a data URL that's not an image" do - let(:url) { "data:application/pdf;base64,aGVsbG8=" } + let(:url) { 'data:application/pdf;base64,aGVsbG8=' } - it "raises" do + it 'raises' do expect { subject }.to raise_error Prawn::SVG::UrlLoader::Error, /image/ end end context "with a data URL that's not base64 encoded" do - let(:url) { "data:image/png;base32,agvsbg" } + let(:url) { 'data:image/png;base32,agvsbg' } - it "raises" do + it 'raises' do expect { subject }.to raise_error Prawn::SVG::UrlLoader::Error, /base64/ end end end