Sha256: b30bcfbd1faec0cc6ec8bd285f3bd3c65b1e373af0e8646f5699e76a5d55b784

Contents?: true

Size: 1007 Bytes

Versions: 10

Compression:

Stored size: 1007 Bytes

Contents

require 'spec_helper'

describe ReverseAsciidoctor::Converters::Img do

  let(:converter) { ReverseAsciidoctor::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

10 entries across 10 versions & 2 rubygems

Version Path
reverse_adoc-0.2.8 spec/lib/reverse_asciidoctor/converters/img_spec.rb
reverse_adoc-0.2.7 spec/lib/reverse_asciidoctor/converters/img_spec.rb
reverse_adoc-0.2.6 spec/lib/reverse_asciidoctor/converters/img_spec.rb
reverse_adoc-0.2.5 spec/lib/reverse_asciidoctor/converters/img_spec.rb
reverse_adoc-0.2.4 spec/lib/reverse_asciidoctor/converters/img_spec.rb
reverse_adoc-0.2.3 spec/lib/reverse_asciidoctor/converters/img_spec.rb
reverse_asciidoctor-0.2.2 spec/lib/reverse_asciidoctor/converters/img_spec.rb
reverse_asciidoctor-0.2.1 spec/lib/reverse_asciidoctor/converters/img_spec.rb
reverse_asciidoctor-0.2.0 spec/lib/reverse_asciidoctor/converters/img_spec.rb
reverse_asciidoctor-0.1.0 spec/lib/reverse_asciidoctor/converters/img_spec.rb