Sha256: e5ed4584806b2b6f3b7c2f5703a2d6969b8c716c9ce1c87e3c787cad27055ddc

Contents?: true

Size: 907 Bytes

Versions: 6

Compression:

Stored size: 907 Bytes

Contents

# frozen_string_literal: true

require 'rspec'
require 'webmock/rspec'

$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')

require 'action_kit_rest'

RSpec.configure do |config|
  config.include WebMock::API

  config.before(:each) do
    WebMock.reset!
  end
  config.after(:each) do
    WebMock.reset!
  end

  config.mock_with :rspec do |mocks|
    mocks.syntax = %i[should expect]
  end

  config.expect_with :rspec do |c|
    c.syntax = %i[should expect]
  end
end

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

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

def stub_put(path)
  stub_action_kit_request(:put, path)
end

def stub_action_kit_request(method, path)
  stub_request(method, "https://test.com/rest/v1/#{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

6 entries across 6 versions & 1 rubygems

Version Path
action_kit_rest-0.4.10 spec/spec_helper.rb
action_kit_rest-0.4.9 spec/spec_helper.rb
action_kit_rest-0.4.8 spec/spec_helper.rb
action_kit_rest-0.4.7 spec/spec_helper.rb
action_kit_rest-0.4.6 spec/spec_helper.rb
action_kit_rest-0.4.5 spec/spec_helper.rb