Sha256: 3ad9c476305b57476a6be7865bba5296740084228b7b7d5f1f66393dc4086e5d

Contents?: true

Size: 1.2 KB

Versions: 15

Compression:

Stored size: 1.2 KB

Contents

# frozen_string_literal:true

require 'rails_helper'

class BaseSpecTag < DocTemplate::Tags::BaseTag
  TAG_NAME = 'image'
end

describe ::DocTemplate::Tags::BaseTag do
  describe '.tag_with_html_regexp' do
    let(:content) do
      <<~HTML
        <p style='padding:0;font-size:11pt;font-family:\"Arial\";line-height:1.5;text-align:left'><span style='
        vertical-align:baseline;font-size:11pt;font-family:\"Cabin\";'>[image:OP.PT.L13.014, 50, Esta imagen
        muestra ruedas de carretas que han sido enterradas por la tierra movida por el viento durante una
        tormenta de polvo.] Los Estados Unidos tienen una historia trágica con sedimentos en movimiento por el viento
        Durante la década de 1930, gran parte de los Estados Unidos estaba pasando por una sequía.</span></p>
      HTML
    end

    subject { BaseSpecTag.tag_with_html_regexp }

    it 'returns RegExp for a single match only' do
      data = subject.match(content)
      expect(data.size).to eq 1
    end

    context 'when TAG_NAME is not defined' do
      before { BaseSpecTag.send :remove_const, :TAG_NAME }

      it 'raises an error' do
        expect { subject }.to raise_error(NotImplementedError)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
lcms-engine-0.5.5 spec/lib/doc_template/tags/base_tag_spec.rb
lcms-engine-0.5.4 spec/lib/doc_template/tags/base_tag_spec.rb
lcms-engine-0.5.3 spec/lib/doc_template/tags/base_tag_spec.rb
lcms-engine-0.5.2 spec/lib/doc_template/tags/base_tag_spec.rb
lcms-engine-0.5.1 spec/lib/doc_template/tags/base_tag_spec.rb
lcms-engine-0.5.0 spec/lib/doc_template/tags/base_tag_spec.rb
lcms-engine-0.4.2 spec/lib/doc_template/tags/base_tag_spec.rb
lcms-engine-0.4.1 spec/lib/doc_template/tags/base_tag_spec.rb
lcms-engine-0.4.0 spec/lib/doc_template/tags/base_tag_spec.rb
lcms-engine-0.3.1 spec/lib/doc_template/tags/base_tag_spec.rb
lcms-engine-0.1.4 spec/lib/doc_template/tags/base_tag_spec.rb
lcms-engine-0.3.0 spec/lib/doc_template/tags/base_tag_spec.rb
lcms-engine-0.1.3 spec/lib/doc_template/tags/base_tag_spec.rb
lcms-engine-0.2.0 spec/lib/doc_template/tags/base_tag_spec.rb
lcms-engine-0.1.2 spec/lib/doc_template/tags/base_tag_spec.rb