Sha256: 1e5371e2413e8385a722c91dd76eecc39fe2673463d3d46cb4c1ff688a0a69f0

Contents?: true

Size: 1.05 KB

Versions: 9

Compression:

Stored size: 1.05 KB

Contents

require 'spec_helper'

describe ReverseAsciidoctor do
  let(:input)    { File.read('spec/assets/minimum.html') }
  let(:document) { Nokogiri::HTML(input) }

  it "parses nokogiri documents" do
    expect { ReverseAsciidoctor.convert(document) }.not_to raise_error
  end

  it "parses nokogiri elements" do
    expect { ReverseAsciidoctor.convert(document.root) }.not_to raise_error
  end

  it "parses string input" do
    expect { ReverseAsciidoctor.convert(input) }.not_to raise_error
  end

  it "behaves in a sane way when root element is nil" do
    expect(ReverseAsciidoctor.convert(nil)).to eq ''
  end

  describe '#config' do
    it 'stores a given configuration option' do
      ReverseAsciidoctor.config.tag_border = true
      expect(ReverseAsciidoctor.config.tag_border).to eq true
    end

    it 'can be used as a block configurator as well' do
      ReverseAsciidoctor.config do |config|
        expect(config.tag_border).to eq " "
        config.tag_border = true
      end
      expect(ReverseAsciidoctor.config.tag_border).to eq true
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

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