Sha256: 5e5c9782d3d3c4c593f0256aa1e526735ff6711b5e3578d787f4f94e9081d7bc

Contents?: true

Size: 624 Bytes

Versions: 4

Compression:

Stored size: 624 Bytes

Contents

require 'spec_helper'

describe GithubApi do

  before(:each)  do
    @options = {:token => '1234',
      :owner => "FooBert",
      :repository => "uber-repo"
    }

    @api = GithubApi.new(@options)
  end

  it "returns the branches of a Github repository" do
    response = []
    response << {"name" => "foo"}
    response << {"name" => "bar"}
    @api.class.should_receive(:get).with("/repos/#{@options[:owner]}/#{@options[:repository]}/branches?access_token=#{@options[:token]}",{}).and_return(response)

    branches = @api.get_branches
    branches.should include "foo"
    branches.should include "bar"
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
kraken-build-0.0.4 spec/lib/github_api_spec.rb
kraken-build-0.0.3 spec/lib/github_api_spec.rb
kraken-build-0.0.2 spec/lib/github_api_spec.rb
kraken-build-0.0.1 spec/lib/github_api_spec.rb