Sha256: f3383bbe2392c7ed9368523a356f47e1408fc548613912a1e441d5c8f404216b

Contents?: true

Size: 992 Bytes

Versions: 6

Compression:

Stored size: 992 Bytes

Contents

require 'spec_helper'

describe ReverseAdoc::Converters::Img do

  let(:converter) { ReverseAdoc::Converters::Img.new }

  it 'converts image with no attributes' do
    node = node_for("<img src='example.jpg'/>")
    expect(converter.convert(node)).to include "image::example.jpg[]"
  end

  it 'converts image with full set of attributes' do
    node = node_for("<img id='A' alt='Alt Text' src='example.jpg' width='30' height='40'/>")
    expect(converter.convert(node)).to include "[[A]]\nimage::example.jpg[Alt Text,30,40]"
  end

  it 'converts image with alt text, no width and height' do
    node = node_for("<img id='A' alt='Alt Text' src='example.jpg'/>")
    expect(converter.convert(node)).to include "[[A]]\nimage::example.jpg[Alt Text]"
  end

  it 'converts image with width and height, no alt text' do
    node = node_for("<img id='A' src='example.jpg' width='30' height='40'/>")
    expect(converter.convert(node)).to include "[[A]]\nimage::example.jpg[\"\",30,40]"
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
reverse_adoc-0.3.7 spec/lib/reverse_adoc/converters/img_spec.rb
reverse_adoc-0.3.6 spec/lib/reverse_adoc/converters/img_spec.rb
reverse_adoc-0.3.5 spec/lib/reverse_adoc/converters/img_spec.rb
reverse_adoc-0.3.4 spec/lib/reverse_adoc/converters/img_spec.rb
reverse_adoc-0.3.3 spec/lib/reverse_adoc/converters/img_spec.rb
reverse_adoc-0.3.1 spec/lib/reverse_adoc/converters/img_spec.rb