|
2 | 2 |
|
3 | 3 | require 'spec_helper' |
4 | 4 |
|
5 | | -describe Github::Client::Repos, '#branches' do |
| 5 | +describe Github::Client::Repos::Branches, '#list' do |
6 | 6 | let(:user) { 'peter-murach' } |
7 | 7 | let(:repo) { 'github' } |
8 | 8 | let(:request_path) { "/repos/#{user}/#{repo}/branches" } |
|
19 | 19 | let(:status) { 200 } |
20 | 20 |
|
21 | 21 | it "should raise error when no user/repo parameters" do |
22 | | - expect { subject.branches nil, repo }.to raise_error(ArgumentError) |
| 22 | + expect { subject.list nil, repo }.to raise_error(ArgumentError) |
23 | 23 | end |
24 | 24 |
|
25 | 25 | it "should raise error when no repository" do |
26 | | - expect { subject.branches user, nil }.to raise_error(ArgumentError) |
| 26 | + expect { subject.list user, nil }.to raise_error(ArgumentError) |
27 | 27 | end |
28 | 28 |
|
29 | 29 | it "should find resources" do |
30 | | - subject.branches user, repo |
| 30 | + subject.list user, repo |
31 | 31 | a_get(request_path).should have_been_made |
32 | 32 | end |
33 | 33 |
|
34 | 34 | it_should_behave_like 'an array of resources' do |
35 | | - let(:requestable) { subject.branches user, repo } |
| 35 | + let(:requestable) { subject.list user, repo } |
36 | 36 | end |
37 | 37 |
|
38 | 38 | it "should get branch information" do |
39 | | - branches = subject.branches user, repo |
| 39 | + branches = subject.list user, repo |
40 | 40 | branches.first.name.should == 'master' |
41 | 41 | end |
42 | 42 |
|
43 | 43 | it "should yield to a block" do |
44 | 44 | block = lambda { |el| repo } |
45 | | - subject.should_receive(:branches).with(user, repo).and_yield repo |
46 | | - subject.branches(user, repo, &block) |
| 45 | + subject.should_receive(:list).with(user, repo).and_yield repo |
| 46 | + subject.list(user, repo, &block) |
47 | 47 | end |
48 | 48 | end |
49 | 49 |
|
50 | 50 | it_should_behave_like 'request failure' do |
51 | | - let(:requestable) { subject.branches user, repo } |
| 51 | + let(:requestable) { subject.list user, repo } |
52 | 52 | end |
53 | 53 | end # branches |
0 commit comments