module HammerCLI::Testing::DataHelpers

Public Instance Methods

load_json(file_path, test_file_context=nil) click to toggle source
# File lib/hammer_cli/testing/data_helpers.rb, line 4
def load_json(file_path, test_file_context=nil)
  unless test_file_context.nil?
    file_path = File.join(File.dirname(test_file_context), file_path)
  end
  JSON.parse(File.read(file_path))
end
load_yaml(file_path, test_file_context=nil) click to toggle source
# File lib/hammer_cli/testing/data_helpers.rb, line 11
def load_yaml(file_path, test_file_context=nil)
  unless test_file_context.nil?
    file_path = File.join(File.dirname(test_file_context), file_path)
  end
  YAML.load(File.read(file_path))
end