Sha256: fa15519ca1bf59a1b48af746031baf6f28720c21deb0416cba35a8881fdb111e

Contents?: true

Size: 710 Bytes

Versions: 3

Compression:

Stored size: 710 Bytes

Contents

require 'test_helper'

module DragonflySvg
  module Processors
    describe ExtendIds do

      let(:app) { test_app.configure_with(:svg) }
      let(:processor) { DragonflySvg::Processors::ExtendIds.new }
      let(:analyser) { DragonflySvg::Analysers::SvgProperties.new }
      let(:svg) { Dragonfly::Content.new(app, SAMPLES_DIR.join('sample.svg')) }

      before do
        @orig_id = analyser.call(svg)[:id]
      end

      it 'adds unique ID' do
        processor.call(svg)
        analyser.call(svg)[:id].wont_equal @orig_id
      end

      it 'adds supplied string to ID' do
        processor.call(svg, 'foo')
        analyser.call(svg)[:id].must_equal "#{@orig_id}-foo"
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dragonfly_svg-0.0.3 test/dragonfly_svg/processors/extend_ids_test.rb
dragonfly_svg-0.0.2 test/dragonfly_svg/processors/extend_ids_test.rb
dragonfly_svg-0.0.1 test/dragonfly_svg/processors/extend_ids_test.rb