Sha256: 4ec2c6ef72f5019cd5e21cf1fa64c02c9e86bcc2844a3cb383f206df45d0b7b7

Contents?: true

Size: 818 Bytes

Versions: 1

Compression:

Stored size: 818 Bytes

Contents

require 'helper'

describe Octokit::Client do

  it 'should work with basic auth' do
    stub_get("https://foo%2Ftoken:bar@github.com/api/v2/json/commits/list/baz/quux/master").
      with(:headers => {'Accept'=>'*/*'}).
      to_return(:status => 200, :body => '{"commits":[]}', :headers => {})
    proc {
      Octokit::Client.new(:login => 'foo', :token => 'bar').commits('baz/quux')
    }.should_not raise_exception
  end

  it 'should work with basic auth and password' do
    stub_get("https://foo:bar@github.com/api/v2/json/commits/list/baz/quux/master").
      with(:headers => {'Accept'=>'*/*'}).
      to_return(:status => 200, :body => '{"commits":[]}', :headers => {})
    proc {
      Octokit::Client.new(:login => 'foo', :password => 'bar').commits('baz/quux')
    }.should_not raise_exception
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
octokit-0.6.4 spec/octokit/client_spec.rb