Sha256: da655fac82746b5f07305139d520112b6148dda7e230310e1d3d0f2c8eeb58bf

Contents?: true

Size: 1.06 KB

Versions: 75

Compression:

Stored size: 1.06 KB

Contents

# frozen_string_literal: true

require 'aranha/parsers/source_target_fixtures'

RSpec.describe ::Aranha::Parsers::SourceTargetFixtures do
  let(:fixtures_dir) { ::File.join(__dir__, 'source_target_fixtures_spec_files') }
  let(:instance) { described_class.new(fixtures_dir) }

  describe '#source_target_files' do
    it { expect(instance.source_target_files.count).to eq(3) }

    (1..3).each do |index|
      basename = "stub#{index}"
      let(basename) { instance.source_target_files.find { |stf| stf.basename == basename } }

      it { expect(send(basename)).to be_present }
      it { expect(send(basename).basename).to eq(basename) }
    end

    it { expect(stub1.source).to eq(::File.join(fixtures_dir, 'stub1.source.txt')) }
    it { expect(stub1.target).to eq(::File.join(fixtures_dir, 'stub1.target.html')) }
    it { expect(stub2.source).to eq(::File.join(fixtures_dir, 'stub2.source.html')) }
    it { expect(stub2.target).to eq(nil) }
    it { expect(stub3.source).to eq(nil) }
    it { expect(stub3.target).to eq(::File.join(fixtures_dir, 'stub3.target.yaml')) }
  end
end

Version data entries

75 entries across 75 versions & 2 rubygems

Version Path
ehbrs-tools-0.25.0 vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec.rb
ehbrs-tools-0.24.0 vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec.rb
ehbrs-tools-0.23.1 vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec.rb
ehbrs-tools-0.23.0 vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec.rb
ehbrs-tools-0.22.0 vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec.rb
ehbrs-tools-0.21.0 vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec.rb
ehbrs-tools-0.20.0 vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec.rb
ehbrs-tools-0.19.0 vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec.rb
ehbrs-tools-0.18.0 vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec.rb
ehbrs-tools-0.17.0 vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec.rb
ehbrs-tools-0.16.5 vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec.rb
ehbrs-tools-0.16.4 vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec.rb
ehbrs-tools-0.16.3 vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec.rb
ehbrs-tools-0.16.2 vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec.rb
ehbrs-tools-0.16.1 vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec.rb