Sha256: 0c75bb53ceef6dd4e7912a7c889be8b617a6044481312fa191433aea7c6695b0

Contents?: true

Size: 1.18 KB

Versions: 20

Compression:

Stored size: 1.18 KB

Contents

unless ENV['CI']
  require 'simplecov'
  SimpleCov.start do
    add_filter "/spec"
  end
end
require 'octokit'
require 'rspec'
require 'webmock/rspec'

def a_delete(url)
  a_request(:delete, github_url(url))
end

def a_get(url)
  a_request(:get, github_url(url))
end

def a_patch(url)
  a_request(:patch, github_url(url))
end

def a_post(url)
  a_request(:post, github_url(url))
end

def a_put(url)
  a_request(:put, github_url(url))
end

def stub_delete(url)
  stub_request(:delete, github_url(url))
end

def stub_get(url)
  stub_request(:get, github_url(url))
end

def stub_patch(url)
  stub_request(:patch, github_url(url))
end

def stub_post(url)
  stub_request(:post, github_url(url))
end

def stub_put(url)
  stub_request(:put, github_url(url))
end

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

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

def github_url(url)
  if url =~ /^http/
    url
  elsif @client && @client.authenticated?
    "https://#{@client.login}:#{@client.password}@api.github.com#{url}"
  elsif @client && @client.oauthed?
    "https://api.github.com#{url}?access_token=#{@client.oauth_token}"
  else
    "https://api.github.com#{url}"
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
octokit-1.17.0 spec/helper.rb
octokit-1.15.1 spec/helper.rb
octokit-1.15.0 spec/helper.rb
octokit-1.14.0 spec/helper.rb
octokit-1.13.0 spec/helper.rb
octokit-1.12.0 spec/helper.rb
octokit-1.11.0 spec/helper.rb
octokit-1.10.0 spec/helper.rb
octokit-1.9.4 spec/helper.rb
octokit-1.9.3 spec/helper.rb
octokit-1.9.2 spec/helper.rb
octokit-1.9.1 spec/helper.rb
octokit-1.8.1 spec/helper.rb
octokit-1.8.0 spec/helper.rb
octokit-1.7.0 spec/helper.rb
octokit-1.6.1 spec/helper.rb
octokit-1.6.0 spec/helper.rb
octokit-1.5.0 spec/helper.rb
octokit-1.4.0 spec/helper.rb
octokit-1.3.0 spec/helper.rb