Sha256: cb296031864820b95d9d95562030cd788a89bafe6f736ff334f60bc530416fbf

Contents?: true

Size: 987 Bytes

Versions: 4

Compression:

Stored size: 987 Bytes

Contents

# frozen_string_literal: true

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'rspec'
require 'webmock/rspec'
require 'tokyo_api'

# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].sort.each { |f| require f }

RSpec.configure do |config|
  config.include WebMock::API
  config.color = true
  # config.raise_errors_for_deprecations!
end

def stub_get(path)
  stub_tokyo_request(:get, path)
end

def stub_post(path)
  stub_tokyo_request(:post, path)
end

def stub_tokyo_request(method, path)
  prefix = TokyoApi.new.connection.configuration.prefix.to_s
  scheme = TokyoApi.new.connection.configuration.scheme.to_s
  stub_request(method, "#{scheme}://test.com" + prefix + path)
end

def fixture_path
  File.expand_path('fixtures', __dir__)
end

def fixture(file)
  File.new(File.join(fixture_path, '/', file))
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tokyo_api-1.9.0 spec/spec_helper.rb
tokyo_api-1.8.0 spec/spec_helper.rb
tokyo_api-1.7.0 spec/spec_helper.rb
tokyo_api-1.6.0 spec/spec_helper.rb