Sha256: bd9eef0245c3eba2cf1a3f53cc095ec823b865107a3a667060644fc1bae6f986

Contents?: true

Size: 855 Bytes

Versions: 64

Compression:

Stored size: 855 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/core_ext'

module Aranha
  module Parsers
    module Rspec
      class SourceTargetFixturesController
        enable_simple_cache
        common_constructor :example, :spec_file

        def default_fixtures_dir
          ::File.join(
            ::File.dirname(spec_file),
            ::File.basename(spec_file, '.*') + '_files'
          )
        end

        def fixtures_dir
          if example.respond_to?(:fixtures_dir)
            example.fixtures_dir
          else
            default_fixtures_dir
          end
        end

        def write_target_fixtures?
          ENV['WRITE_TARGET_FIXTURES'].to_bool
        end

        private

        def source_target_fixtures_uncached
          ::Aranha::Parsers::SourceTargetFixtures.new(fixtures_dir)
        end
      end
    end
  end
end

Version data entries

64 entries across 64 versions & 2 rubygems

Version Path
eac_tools-0.55.0 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.54.0 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.53.0 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.52.0 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.51.0 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.50.0 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.49.0 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.48.1 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.48.0 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.47.2 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.47.1 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.47.0 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.46.0 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.45.2 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.45.1 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.45.0 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.44.0 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.43.0 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.42.0 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.41.0 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb