Sha256: f2dddc20dba2956c9f9444e8908305f6225b3b44ec4ac9cc585ab26c26a9cb6b

Contents?: true

Size: 947 Bytes

Versions: 6

Compression:

Stored size: 947 Bytes

Contents

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 = [:should, :expect]
  end

  config.expect_with :rspec do |c|
    c.syntax = [: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)
  prefix = ActionKitRest.new.connection.configuration.prefix.to_s
  stub_request(method, 'https://test.com' + prefix + path)
end

def fixture_path
  File.expand_path("../fixtures", __FILE__)
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.3.3 spec/spec_helper.rb
action_kit_rest-0.3.2 spec/spec_helper.rb
action_kit_rest-0.3.1 spec/spec_helper.rb
action_kit_rest-0.3.0 spec/spec_helper.rb
action_kit_rest-0.2.2 spec/spec_helper.rb
action_kit_rest-0.2.1 spec/spec_helper.rb