Sha256: ac7d427f177be4926e128104d8597998527d967b5b255577429347e5ad298329

Contents?: true

Size: 633 Bytes

Versions: 1

Compression:

Stored size: 633 Bytes

Contents

def do_config
  config = HelloSign.configure
  config.instantiate_files = false
  config.root_file_path = __dir__ + "/../oas/test_fixtures"

  config
end

def set_expected_response(code, body, content_type = 'application/json')
  Typhoeus.stub(/hellosign.com/) do
    Typhoeus::Response.new(
      :code    => code,
      :headers => ['Content-Type' => content_type],
      :body    => body,
    )
  end
end

def get_fixture_data(file)
  path = "#{HelloSign.configure.root_file_path}/#{file}.json"

  if ! File.exist? path
    raise "Fixture file #{path} not found"
  end

  JSON.parse(File.read(path), :symbolize_names => true)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hellosign-ruby-sdk-6.0.0.pre.beta spec/test_utils.rb