Class: Clumsy::TestFile

Inherits:
Object
  • Object
show all
Defined in:
lib/clumsy/test_file.rb

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ TestFile

Returns a new instance of TestFile.



4
5
6
7
8
9
10
11
# File 'lib/clumsy/test_file.rb', line 4

def initialize(file)
  begin
    @file = File.read(file)
    @data = Hashie::Mash.new JSON.parse(@file)
  rescue Errno::ENOENT
    raise 'File Not Found'
  end
end

Instance Method Details

#downstreamObject



21
22
23
# File 'lib/clumsy/test_file.rb', line 21

def downstream
  @data.downstream
end

#request_methodObject



13
14
15
# File 'lib/clumsy/test_file.rb', line 13

def request_method
  @data.request_method
end

#request_urlObject



17
18
19
# File 'lib/clumsy/test_file.rb', line 17

def request_url
  @data.request_url
end

#responseObject



25
26
27
# File 'lib/clumsy/test_file.rb', line 25

def response
  @data.response
end