Sha256: 9fa828309b1b108827b4fb495e9fbac27404f9937bc8816241308eadd4418ef4

Contents?: true

Size: 961 Bytes

Versions: 6

Compression:

Stored size: 961 Bytes

Contents

require_relative '../lib/inline_svg'

describe InlineSvg do
  describe "configuration" do
    context "when a block is not given" do
      it "complains" do
        expect do
          InlineSvg.configure
        end.to raise_error(InlineSvg::Configuration::Invalid)
      end
    end

    context "asset finder" do
      it "allows an asset finder to be assigned" do
        sprockets = double('SomethingLikeSprockets', find_asset: 'some asset')
        InlineSvg.configure do |config|
          config.asset_finder = sprockets
        end

        expect(InlineSvg.configuration.asset_finder).to eq sprockets
      end

      it "complains when the provided asset finder does not implement #find_asset" do
        expect do
          InlineSvg.configure do |config|
            config.asset_finder = 'Not a real asset finder'
          end
        end.to raise_error(InlineSvg::Configuration::Invalid, /asset finder.*find_asset/i)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
inline_svg-0.5.3 spec/inline_svg_spec.rb
inline_svg-0.5.2 spec/inline_svg_spec.rb
inline_svg-0.5.1 spec/inline_svg_spec.rb
inline_svg-0.5.0 spec/inline_svg_spec.rb
inline_svg-0.4.0 spec/inline_svg_spec.rb
inline_svg-0.3.0 spec/inline_svg_spec.rb