Skip to content

Commit 4db6098

Browse files
committed
Check .followers and .followed with a block in following_spec
1 parent b7e0d4e commit 4db6098

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

spec/bitbucket_rest_api/repos/following_spec.rb

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,19 @@
1010
'/1.0/repositories/mock_username/mock_repo/followers/',
1111
{},
1212
{}
13-
)
13+
).and_return(['follower1', 'follower2', 'follower3'])
1414
end
1515

16-
it 'should send a GET request for the followers belonging to the given repo' do
17-
following.followers('mock_username', 'mock_repo')
16+
context 'without a block' do
17+
it 'should send a GET request for the followers belonging to the given repo' do
18+
following.followers('mock_username', 'mock_repo')
19+
end
20+
end
21+
22+
context 'with a block' do
23+
it 'should send a GET request for the followers belonging to the given repo' do
24+
following.followers('mock_username', 'mock_repo') { |follower| follower }
25+
end
1826
end
1927
end
2028

@@ -26,11 +34,19 @@
2634
'/1.0/user/follows',
2735
{},
2836
{}
29-
)
37+
).and_return(['followed1', 'followed2', 'followed3'])
38+
end
39+
40+
context 'without a block' do
41+
it 'should send a GET request for the followers belonging to a particular user' do
42+
following.followed
43+
end
3044
end
3145

32-
it 'should send a GET request for the followers belonging to a particular user' do
33-
following.followed
46+
context 'with a block' do
47+
it 'should send a GET request for the followers belonging to a particular user' do
48+
following.followed { |followed| followed }
49+
end
3450
end
3551
end
3652
end

0 commit comments

Comments
 (0)