dnesteryuk/site_prism.vcr

View on GitHub
lib/site_prism_vcr/fixtures/modifiers/relative_path.rb

Summary

Maintainability
A
0 mins
Test Coverage
require 'pathname'
require_relative 'base'

module SPV
  class Fixtures
    module Modifiers
      # It allows to move up through a hierarchy of directories.
      #
      # Example:
      #  ~/../some_fixture
      #
      class RelativePath < Base
        def modify(fixture)
          path = Pathname.new(fixture.path)

          fixture.path = path.cleanpath.to_path
        end
      end
    end
  end
end