class SPV::Fixtures::Modifiers::ShortcutPath

It takes a fixture and replaces a shortcut path with a full path to it.

Public Instance Methods

modify(fixture) click to toggle source
# File lib/site_prism_vcr/fixtures/modifiers/shortcut_path.rb, line 9
def modify(fixture)
  if shortcut = fixture.shortcut_path
    if path = @options.shortcut_path(shortcut)
      fixture.set_home_path(path)
    else
      raise ArgumentError.new(
        "You are trying to use the '#{shortcut}' shortcut path for #{fixture.name} fixture. " \
        "This shortcut path cannot be used since it is not defined, please refer to the documentation " \
        "to make sure you properly define the shortcut path."
      )
    end
  end
end