Sha256: 8e72f8d508beec822b1b150f55c31db64aa7db6da16bbf8b7f9e79b835e078b7
Contents?: true
Size: 1.84 KB
Versions: 4
Compression:
Stored size: 1.84 KB
Contents
require 'fileutils' describe DocTest::AsciidocConverter do subject { described_class } it { is_expected.to have_method :convert, :call } describe '#initialize' do context 'with defaults' do subject { described_class.new.opts } it { is_expected.to include safe: :safe } end context 'with backend_name' do subject { described_class.new(backend_name: 'html5').opts } it { is_expected.to include backend: 'html5' } context 'empty string' do subject { described_class.new(backend_name: '').opts } it { is_expected.to_not include :backend } end end context 'with template_dirs' do include FakeFS::SpecHelpers subject { described_class.new(template_dirs: template_dirs).opts } let(:template_dirs) { ['/tmp/html5'] } before { FileUtils.mkpath template_dirs[0] } context 'that exists' do it do is_expected.to include( template_dirs: template_dirs, converter: DocTest::NoFallbackTemplateConverter ) end context 'and templates_fallback is true' do subject { described_class.new(template_dirs: template_dirs, templates_fallback: true).opts } it { is_expected.to include template_dirs: template_dirs } it { is_expected.to_not include :converter } end context 'and custom converter' do subject { described_class.new(template_dirs: template_dirs, converter: converter).opts } let(:converter) { Asciidoctor::Converter::TemplateConverter } it { is_expected.to include template_dirs: template_dirs, converter: converter } end end context "that doesn't exist" do let(:template_dirs) { ['/tmp/html5', '/tmp/revealjs'] } it { expect { subject }.to raise_error ArgumentError } end end end end
Version data entries
4 entries across 4 versions & 1 rubygems