Sha256: 746364c62e321bcdb05796cadaca9a127fcf7a92be621c2c1c5f6cfe03789264

Contents?: true

Size: 841 Bytes

Versions: 6

Compression:

Stored size: 841 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe 'exe/revrse_adoc' do
  subject(:convert) do
    ShellUtils.execute!("./exe/reverse_adoc -e -o test1 #{input_file_path}")
  end
  unless Gem.win_platform?
    context 'when external images present' do
      let(:input_file_path) { 'spec/assets/external_images.html' }
      let(:images_folder) { 'images' }

      after do
        FileUtils.rm_rf(images_folder) if File.directory?(images_folder)
      end

      it 'Does not raise error' do
        expect { convert }.to_not raise_error
      end

      it 'exatracts images from source html' do
        expect { convert }
          .to(change do
            Dir["#{images_folder}/*gif"]
              .map { |entry| File.basename(entry) }
              .sort
          end.from([]).to(['001.gif']))
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
reverse_adoc-0.3.7 spec/bin/reverse_adoc_spec.rb
reverse_adoc-0.3.6 spec/bin/reverse_adoc_spec.rb
reverse_adoc-0.3.5 spec/bin/reverse_adoc_spec.rb
reverse_adoc-0.3.4 spec/bin/reverse_adoc_spec.rb
reverse_adoc-0.3.3 spec/bin/reverse_adoc_spec.rb
reverse_adoc-0.3.1 spec/bin/reverse_adoc_spec.rb