Sha256: 9b1cb740677f615b53034fa1ba0b30d0f80d807f282f499b3417bb02a011513e

Contents?: true

Size: 1.26 KB

Versions: 14

Compression:

Stored size: 1.26 KB

Contents

# frozen_string_literal: true
require 'test_helper'

module Eac
  class SourceTargetFixturesTest < ActionView::TestCase
    def test_source_target_files
      r = ::Eac::SourceTargetFixtures.new(fixtures_dir).source_target_files
      assert_equal 3, r.count

      a = r.find { |x| x.source && File.basename(x.source) == 'a.source.html' }
      assert a
      assert_equal File.join(fixtures_dir, 'a.source.html'), a.source
      assert_equal File.join(fixtures_dir, 'a.target.yaml'), a.target

      b = r.find { |x| x.source && File.basename(x.source) == 'b.source.html' }
      assert b
      assert_equal File.join(fixtures_dir, 'b.source.html'), b.source
      assert_nil b.target

      c = r.find { |x| x.target && File.basename(x.target) == 'c.target.yaml' }
      assert c
      assert_nil c.source
      assert_equal File.join(fixtures_dir, 'c.target.yaml'), c.target
    end

    def test_source_files
      r = ::Eac::SourceTargetFixtures.new(fixtures_dir).source_files
      assert_equal 2, r.count

      %w(a.source.html b.source.html).each do |expected|
        assert r.include?(File.join(fixtures_dir, expected)), expected
      end
    end

    private

    def fixtures_dir
      File.expand_path('../source_target_fixtures_test_files', __FILE__)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
eac_rails_utils-0.8.0 test/lib/eac/source_target_fixtures_test.rb
eac_rails_utils-0.7.1 test/lib/eac/source_target_fixtures_test.rb
eac_rails_utils-0.7.0 test/lib/eac/source_target_fixtures_test.rb
eac_rails_utils-0.6.0 test/lib/eac/source_target_fixtures_test.rb
eac_rails_utils-0.5.0 test/lib/eac/source_target_fixtures_test.rb
eac_rails_utils-0.4.0 test/lib/eac/source_target_fixtures_test.rb
eac_rails_utils-0.3.0 test/lib/eac/source_target_fixtures_test.rb
eac_rails_utils-0.2.2 test/lib/eac/source_target_fixtures_test.rb
eac_rails_utils-0.2.1 test/lib/eac/source_target_fixtures_test.rb
eac_rails_utils-0.2.0 test/lib/eac/source_target_fixtures_test.rb
eac_rails_utils-0.1.15 test/lib/eac/source_target_fixtures_test.rb
eac_rails_utils-0.1.14 test/lib/eac/source_target_fixtures_test.rb
eac_rails_utils-0.1.13 test/lib/eac/source_target_fixtures_test.rb
eac_rails_utils-0.1.12 test/lib/eac/source_target_fixtures_test.rb