Skip to content

Commit 940b11a

Browse files
committed
Change to new spec syntax.
1 parent ec03e8c commit 940b11a

6 files changed

Lines changed: 29 additions & 29 deletions

File tree

spec/github/client/activity/notifications/create_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131

3232
it 'should create resource' do
3333
subject.create thread_id, inputs
34-
a_put(request_path).
35-
with(:body => inputs, :query => {:access_token => OAUTH_TOKEN}).
36-
should have_been_made
34+
expect(a_put(request_path).
35+
with(:body => inputs, :query => {:access_token => OAUTH_TOKEN})).
36+
to have_been_made
3737
end
3838

3939
it 'should return the resource' do
4040
thread = subject.create thread_id, inputs
41-
thread.subscribed.should be_true
41+
expect(thread.subscribed).to be_true
4242
end
4343
end
4444
end # create

spec/github/client/activity/notifications/delete_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121

2222
it "should delete the resource successfully" do
2323
subject.delete thread_id
24-
a_delete(request_path).with(:query => {:access_token => OAUTH_TOKEN}).
25-
should have_been_made
24+
expect(a_delete(request_path).with(:query => {:access_token => OAUTH_TOKEN})).
25+
to have_been_made
2626
end
2727

2828
it "should fail to delete resource without 'user' parameter" do

spec/github/client/activity/notifications/get_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,22 @@
2525

2626
it "should find resources" do
2727
subject.get thread_id
28-
a_get(request_path).should have_been_made
28+
expect(a_get(request_path)).to have_been_made
2929
end
3030

3131
it "should return repository mash" do
3232
threads = subject.get thread_id
33-
threads.should be_an Enumerable
34-
threads.should have(1).items
33+
expect(threads).to be_an Enumerable
34+
expect(threads.size).to eq(1)
3535
end
3636

3737
it "should get repository information" do
3838
threads = subject.get thread_id
39-
threads.first.repository.name.should == 'Hello-World'
39+
expect(threads.first.repository.name).to eq('Hello-World')
4040
end
4141

4242
it "should yield repositories to a block" do
43-
subject.should_receive(:get).and_yield('octocat')
43+
expect(subject).to receive(:get).and_yield('octocat')
4444
subject.get(thread_id) { |repo| 'octocat' }
4545
end
4646
end

spec/github/client/activity/notifications/list_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
it 'should get the resource' do
2727
subject.list
28-
a_get(request_path).with(:query => {:access_token => OAUTH_TOKEN}).
29-
should have_been_made
28+
expect(a_get(request_path).with(:query => {:access_token => OAUTH_TOKEN})).
29+
to have_been_made
3030
end
3131

3232
it_should_behave_like 'an array of resources' do
@@ -35,11 +35,11 @@
3535

3636
it "should get resource information" do
3737
notifications = subject.list
38-
notifications.first.repository.name.should == 'Hello-World'
38+
expect(notifications.first.repository.name).to eq('Hello-World')
3939
end
4040

4141
it "should yield repositories to a block" do
42-
subject.should_receive(:list).and_yield('octocat')
42+
expect(subject).to receive(:list).and_yield('octocat')
4343
subject.list { |repo| 'octocat' }
4444
end
4545

@@ -61,8 +61,8 @@
6161

6262
it "should get the resource" do
6363
subject.list :user => user, :repo => repo
64-
a_get(request_path).with(:query => {:access_token => OAUTH_TOKEN}).
65-
should have_been_made
64+
expect(a_get(request_path).with(:query => {:access_token => OAUTH_TOKEN})).
65+
to have_been_made
6666
end
6767
end
6868

spec/github/client/activity/notifications/mark_spec.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727

2828
it 'should get the resource' do
2929
subject.mark(inputs)
30-
a_put(request_path).
31-
with(:body => inputs, :query => {:access_token => OAUTH_TOKEN}).
32-
should have_been_made
30+
expect(a_put(request_path).
31+
with(:body => inputs, :query => {:access_token => OAUTH_TOKEN})).
32+
to have_been_made
3333
end
3434
end
3535

@@ -47,9 +47,9 @@
4747

4848
it 'should get the resource' do
4949
subject.mark inputs.merge(:user => user, :repo => repo)
50-
a_put(request_path).
51-
with(:body => inputs, :query => {:access_token => OAUTH_TOKEN}).
52-
should have_been_made
50+
expect(a_put(request_path).
51+
with(:body => inputs, :query => {:access_token => OAUTH_TOKEN})).
52+
to have_been_made
5353
end
5454
end
5555

@@ -66,9 +66,9 @@
6666

6767
it 'should get the resource' do
6868
subject.mark inputs.merge(:id => thread_id)
69-
a_patch(request_path).
70-
with(:body => inputs, :query => {:access_token => OAUTH_TOKEN}).
71-
should have_been_made
69+
expect(a_patch(request_path).
70+
with(:body => inputs, :query => {:access_token => OAUTH_TOKEN})).
71+
to have_been_made
7272
end
7373
end
7474
end # mark

spec/github/client/activity/notifications/subscribed_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525

2626
it 'gets the resource' do
2727
subject.subscribed? thread_id
28-
a_get(request_path).with(:query => {:access_token => OAUTH_TOKEN }).
29-
should have_been_made
28+
expect(a_get(request_path).with(:query => {:access_token => OAUTH_TOKEN })).
29+
to have_been_made
3030
end
3131

3232
it 'gets resource information' do
3333
subscribed = subject.subscribed? thread_id
34-
subscribed.subscribed.should be_true
34+
expect(subscribed.subscribed).to be_true
3535
end
3636
end
3737

0 commit comments

Comments
 (0)