Sha256: 67e79dc628e523fb760a0e5d29a46109d2cf1b9ab5c05d9152aff1fa41dd2b86

Contents?: true

Size: 780 Bytes

Versions: 2

Compression:

Stored size: 780 Bytes

Contents

module SPV
  class Fixtures
    module Modifiers
      # It takes a fixture and replaces "~/" with
      # a defined home path
      class HomePath
        def initialize(options)
          @options = options
        end

        def modify(fixture)
          if fixture.has_link_to_home_path?
            if @options.home_path
              fixture.set_home_path(@options.home_path)
            else
              raise ArgumentError.new(
                "You are trying to use a home path for #{fixture.name} fixture. " \
                "Home path cannot be used since it is not defined, please refer to the documentation " \
                "to make sure you define the home path properly."
              )
            end
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
site_prism.vcr-0.1.0 lib/site_prism_vcr/fixtures/modifiers/home_path.rb
site_prism.vcr-0.0.1 lib/site_prism_vcr/fixtures/modifiers/home_path.rb