Module: StaticFileFetcher

Defined in:
lib/entrata/utils/static_file_fetcher.rb

Class Method Summary collapse

Class Method Details

.parsed_response_for(method_name) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/entrata/utils/static_file_fetcher.rb', line 14

def self.parsed_response_for(method_name)
  path = File.join(
    File.dirname(__FILE__), '../../../', parsed_response_path(method_name)
  )

  JSON.parse(File.read(path))
end

.parsed_response_path(filename) ⇒ Object



22
23
24
# File 'lib/entrata/utils/static_file_fetcher.rb', line 22

def self.parsed_response_path(filename)
  "spec/support/fixtures/parsed_responses/#{filename}/success.json"
end

.raw_response_for(method_name) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/entrata/utils/static_file_fetcher.rb', line 2

def self.raw_response_for(method_name)
  path = File.join(
    File.dirname(__FILE__), '../../../', raw_response_path(method_name)
  )

  File.read(path)
end

.raw_response_path(filename) ⇒ Object



10
11
12
# File 'lib/entrata/utils/static_file_fetcher.rb', line 10

def self.raw_response_path(filename)
  "spec/support/fixtures/raw_responses/#{filename}/success.json"
end