Sha256: d61c341632bae5dbeab0f30ff94a23391e4d2853ba78419d627c513ff7c2d259

Contents?: true

Size: 966 Bytes

Versions: 3

Compression:

Stored size: 966 Bytes

Contents

require "spec_helper"
require "fileutils"

RSpec.describe Asciidoctor::Iec do
  context "when xref_error.adoc compilation" do
    around do |example|
      FileUtils.rm_f "spec/assets/xref_error.err"
      example.run
      Dir["spec/assets/xref_error*"].each do |file|
        next if file.match?(/adoc$/)

        FileUtils.rm_f(file)
      end
    end

    it "generates error file" do
      expect do
        Metanorma::Compile
          .new
          .compile("spec/assets/xref_error.adoc", type: "iec")
      end.to(change { File.exist?("spec/assets/xref_error.err") }
              .from(false).to(true))
    end
  end

it "Warns of illegal doctype" do
    FileUtils.rm_f "test.err"
    Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)
  = Document title
  Author
  :docfile: test.adoc
  :nodoc:
  :no-isobib:
  :doctype: pizza

  text
  INPUT
    expect(File.read("test.err")).to include "pizza is not a recognised document type"
end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
metanorma-iec-1.2.8 spec/asciidoctor-iec/validate_spec.rb
metanorma-iec-1.2.7 spec/asciidoctor-iec/validate_spec.rb
metanorma-iec-1.2.6 spec/asciidoctor-iec/validate_spec.rb