Sha256: 2da3905379e62a938a0ba9a9e5998b70fc996e2b29cdb04e8ac129318718a9ad

Contents?: true

Size: 1.25 KB

Versions: 2

Compression:

Stored size: 1.25 KB

Contents

unless ENV['CI']
  require 'simplecov'
  SimpleCov.start do
    add_filter 'spec'
  end
end

ENV['THOR_COLUMNS'] = "80"

require 't'
require 'rspec'
require 'timecop'
require 'webmock/rspec'
require 'json'

def a_delete(path, endpoint='https://api.twitter.com')
  a_request(:delete, endpoint + path)
end

def a_get(path, endpoint='https://api.twitter.com')
  a_request(:get, endpoint + path)
end

def a_post(path, endpoint='https://api.twitter.com')
  a_request(:post, endpoint + path)
end

def a_put(path, endpoint='https://api.twitter.com')
  a_request(:put, endpoint + path)
end

def stub_delete(path, endpoint='https://api.twitter.com')
  stub_request(:delete, endpoint + path)
end

def stub_get(path, endpoint='https://api.twitter.com')
  stub_request(:get, endpoint + path)
end

def stub_post(path, endpoint='https://api.twitter.com')
  stub_request(:post, endpoint + path)
end

def stub_put(path, endpoint='https://api.twitter.com')
  stub_request(:put, endpoint + path)
end

def project_path
  File.expand_path("../..", __FILE__)
end

def fixture_path
  File.expand_path("../fixtures", __FILE__)
end

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

def status_from_fixture(file)
  Twitter::Status.new(JSON.parse(fixture(file).read, :symbolize_names => true))
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
t-1.3.0 spec/helper.rb
t-1.2.0 spec/helper.rb