instapaper/spec/spec_helper.rb
stve 6271356847 slight refactor in preparation for adding version 1.1 support
a couple breaking changes as part of this:

* the api version can no longer be set via configuration (since the API
itself now supports more than one version 1 and 1.1 this no longer makes
sense)
* removed module based support, all requests will require an Instapaper::Client from now on
* removed path_prefix configuration for same reasons that the api version was removed
2015-02-09 16:21:30 -05:00

52 lines
1 KiB
Ruby

unless ENV['CI']
require 'simplecov'
SimpleCov.start do
add_filter '.bundle'
add_group 'Instapaper', 'lib/instapaper'
add_group 'Specs', 'spec'
end
end
require 'instapaper'
require 'rspec'
require 'webmock/rspec'
def a_delete(path)
a_request(:delete, Instapaper::Client::DEFAULT_ENDPOINT + path)
end
def a_get(path)
a_request(:get, Instapaper::Client::DEFAULT_ENDPOINT + path)
end
def a_post(path)
a_request(:post, Instapaper::Client::DEFAULT_ENDPOINT + path)
end
def a_put(path)
a_request(:put, Instapaper::Client::DEFAULT_ENDPOINT + path)
end
def stub_delete(path)
stub_request(:delete, Instapaper::Client::DEFAULT_ENDPOINT + path)
end
def stub_get(path)
stub_request(:get, Instapaper::Client::DEFAULT_ENDPOINT + path)
end
def stub_post(path)
stub_request(:post, Instapaper::Client::DEFAULT_ENDPOINT + path)
end
def stub_put(path)
stub_request(:put, Instapaper::Client::DEFAULT_ENDPOINT + path)
end
def fixture_path
File.expand_path('../fixtures', __FILE__)
end
def fixture(file)
File.new(fixture_path + '/' + file)
end