Class: Savon::Spec::Fixture

Inherits:
Object
  • Object
show all
Defined in:
lib/savon/spec/fixture.rb

Overview

Savon::Spec::Fixture

Manages SOAP response fixtures.

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.pathObject

Raises:

  • (ArgumentError)


10
11
12
13
14
15
# File 'lib/savon/spec/fixture.rb', line 10

def path
  @path ||= Rails.root.join("spec", "fixtures").to_s if defined? Rails

  raise ArgumentError, "Savon::Spec::Fixture.path needs to be specified" unless @path
  @path
end

Class Method Details

.load(*args) ⇒ Object Also known as: []



19
20
21
22
# File 'lib/savon/spec/fixture.rb', line 19

def load(*args)
  file = args.map { |arg| arg.to_s.snakecase }.join("/")
  fixtures[file] ||= read_file(file)
end