File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -36,5 +36,11 @@ def following(team_name)
3636 response [ "values" ] . each { |el | yield el }
3737 end
3838
39- end # Users
39+ def repos ( team_name )
40+ response = get_request ( "/2.0/teams/#{ team_name . to_s } /repositories" )
41+ return response unless block_given?
42+ response [ "values" ] . each { |el | yield el }
43+ end
44+
45+ end # Team
4046end # BitBucket
Original file line number Diff line number Diff line change 109109 end
110110 end
111111 end
112+
113+ describe '.repos' do
114+ before do
115+ expect ( team ) . to receive ( :request ) . with (
116+ :get ,
117+ '/2.0/teams/team_name/repositories' ,
118+ { } ,
119+ { }
120+ ) . and_return ( { "values" => [ 'repo1' , 'repo2' , 'repo3' ] } )
121+ end
122+
123+ context "without a block" do
124+ it 'sends a GET request for the repos for the team' do
125+ team . repos ( 'team_name' )
126+ end
127+ end
128+
129+ context "with a block" do
130+ it 'sends a GET request for the repos for the team' do
131+ team . repos ( 'team_name' ) { |repo | repo }
132+ end
133+ end
134+ end
112135end
You can’t perform that action at this time.
0 commit comments