Sha256: f926f796662372b6ef15140e796c7a7d1fc62d021078cd781ba08f8358c198c3

Contents?: true

Size: 458 Bytes

Versions: 8

Compression:

Stored size: 458 Bytes

Contents

require 'gh'

module GH
  class FakeRemote < Remote
    def setup(host, options)
      @authenticated = options[:password] == 'password'
      super
    end

    def post(key, body)
      raise GH::Error unless @authenticated and key == '/authorizations'
      frontend.load("url" => "https://api.github.com/authorizations/1", "token" => "github_token")
    end

    def head(*) end
    def delete(*) end
  end

  DefaultStack.replace(Remote, FakeRemote)
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
travis-1.1.3 spec/support/fake_github.rb
travis-1.1.2 spec/support/fake_github.rb
travis-1.1.1 spec/support/fake_github.rb
travis-1.1.0 spec/support/fake_github.rb
travis-1.0.3 spec/support/fake_github.rb
travis-1.0.2 spec/support/fake_github.rb
travis-1.0.1 spec/support/fake_github.rb
travis-1.0.0 spec/support/fake_github.rb