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
aranha-parsers-0.21.0 lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
aranha-parsers-0.20.0 lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.69.1 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
aranha-parsers-0.19.1 lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.69.0 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.68.0 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
aranha-parsers-0.19.0 lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.67.1 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.67.0 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.66.0 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.65.1 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
aranha-parsers-0.18.0 lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.65.0 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.64.0 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.63.0 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.62.1 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.62.0 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.61.1 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.61.0 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
eac_tools-0.60.3 sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb