Sha256: 914eb5f07c0c6f9800c166a06001caa1a5ed9536e9e7a1b9f9d6e0db9aa10e4d

Contents?: true

Size: 843 Bytes

Versions: 2

Compression:

Stored size: 843 Bytes

Contents

require 'spec_helper'

describe Github::Repos do

  let(:github) { Github.new }
  let(:repo)   { mock('object').as_null_object } 

  before do
    github.stub(:repos).and_return(repo)
  end

  context "branches" do

    before do
      @branches = []
      repo.stub(:branches).and_return([])
    end

    it "should raise error when no user" do
      pending
      expect {
        Github.new.repos.branches
      }.to raise_error(ArgumentError, /\[user\] parameter cannot be nil/)
    end

    it "should raise error when no repo" do
      pending
      expect {
        Github.new(:user => 'peter-murach').repos.branches
      }.to raise_error(ArgumentError, /\[repo\] parameter cannot be nil/)
    end

    it "should list all branches" do
      pending
      github.repos.should_receive(:branches).and_return(@branches)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
github_api-0.1.1 spec/github/repos_spec.rb
github_api-0.1.0 spec/github/repos_spec.rb