Skip to content

Commit c5643eb

Browse files
committed
shifted the branches and branch spec to list and get
1 parent ada51cb commit c5643eb

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

spec/github/client/repos/branch_spec.rb renamed to spec/github/client/repos/branches/get_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require 'spec_helper'
44

5-
describe Github::Client::Repos, '#branch' do
5+
describe Github::Client::Repos::Branches, '#get' do
66
let(:user) { 'peter-murach' }
77
let(:repo) { 'github' }
88
let(:request_path) { "/repos/#{user}/#{repo}/branches/#{branch}" }
@@ -20,22 +20,22 @@
2020
let(:status) { 200 }
2121

2222
it "should find resources" do
23-
subject.branch user, repo, branch
23+
subject.get user, repo, branch
2424
a_get(request_path).should have_been_made
2525
end
2626

2727
it "should return repository mash" do
28-
repo_branch = subject.branch user, repo, branch
28+
repo_branch = subject.get user, repo, branch
2929
repo_branch.should be_a Github::ResponseWrapper
3030
end
3131

3232
it "should get repository branch information" do
33-
repo_branch = subject.branch user, repo, branch
33+
repo_branch = subject.get user, repo, branch
3434
repo_branch.name.should == 'master'
3535
end
3636
end
3737

3838
it_should_behave_like 'request failure' do
39-
let(:requestable) { subject.branch user, repo, branch }
39+
let(:requestable) { subject.get user, repo, branch }
4040
end
41-
end # branch
41+
end # get

spec/github/client/repos/branches_spec.rb renamed to spec/github/client/repos/branches/list_spec.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require 'spec_helper'
44

5-
describe Github::Client::Repos, '#branches' do
5+
describe Github::Client::Repos::Branches, '#list' do
66
let(:user) { 'peter-murach' }
77
let(:repo) { 'github' }
88
let(:request_path) { "/repos/#{user}/#{repo}/branches" }
@@ -19,35 +19,35 @@
1919
let(:status) { 200 }
2020

2121
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)
2323
end
2424

2525
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)
2727
end
2828

2929
it "should find resources" do
30-
subject.branches user, repo
30+
subject.list user, repo
3131
a_get(request_path).should have_been_made
3232
end
3333

3434
it_should_behave_like 'an array of resources' do
35-
let(:requestable) { subject.branches user, repo }
35+
let(:requestable) { subject.list user, repo }
3636
end
3737

3838
it "should get branch information" do
39-
branches = subject.branches user, repo
39+
branches = subject.list user, repo
4040
branches.first.name.should == 'master'
4141
end
4242

4343
it "should yield to a block" do
4444
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)
4747
end
4848
end
4949

5050
it_should_behave_like 'request failure' do
51-
let(:requestable) { subject.branches user, repo }
51+
let(:requestable) { subject.list user, repo }
5252
end
5353
end # branches

0 commit comments

Comments
 (0)