Skip to content

Commit 2aaa483

Browse files
committed
Change to spec syntax.
1 parent 92222d1 commit 2aaa483

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

spec/github/client/gists/list_spec.rb

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

33
require 'spec_helper'
44

5-
describe Github::Client::Gists, '#list' do
5+
RSpec.describe Github::Client::Gists, '#list' do
66
let(:user) { 'peter-murach' }
77
let(:body) { fixture('gists/gists.json') }
88
let(:status) { 200 }
99

1010
before {
11-
stub_get(request_path).to_return(:body => body, :status => status,
12-
:headers => {:content_type => "application/json; charset=utf-8"})
11+
stub_get(request_path).to_return(body: body, status: status,
12+
headers: {content_type: "application/json; charset=utf-8"})
1313
}
1414

1515
after { reset_authentication_for(subject) }
@@ -20,24 +20,24 @@
2020
context "resource found" do
2121
it { should respond_to :all }
2222

23-
it "should get the resources" do
24-
subject.list :user => user
25-
a_get(request_path).should have_been_made
23+
it "gets the resources" do
24+
subject.list(user: user)
25+
expect(a_get(request_path)).to have_been_made
2626
end
2727

2828
it_should_behave_like 'an array of resources' do
2929
let(:requestable) { subject.list :user => user }
3030
end
3131

32-
it "should get gist information" do
33-
gists = subject.list :user => user
34-
gists.first.user.login.should == 'octocat'
32+
it "gets gist information" do
33+
gists = subject.list(user: user)
34+
expect(gists.first.user.login).to eq('octocat')
3535
end
3636

37-
it "should yield to a block" do
37+
it "yields to a block" do
3838
yielded = []
39-
result = subject.list(:user => user) { |obj| yielded << obj }
40-
yielded.should == result
39+
result = subject.list(user: user) { |obj| yielded << obj }
40+
expect(yielded).to eq(result)
4141
end
4242
end
4343

@@ -49,9 +49,9 @@
4949
context 'when public' do
5050
let(:request_path) { "/gists/public" }
5151

52-
it "should get the resources" do
53-
subject.list :public
54-
a_get(request_path).should have_been_made
52+
it "gets the resources" do
53+
subject.list(:public)
54+
expect(a_get(request_path)).to have_been_made
5555
end
5656

5757
it_should_behave_like 'an array of resources' do
@@ -69,10 +69,10 @@
6969
:headers => {:content_type => "application/json; charset=utf-8"})
7070
end
7171

72-
it "should get the resources" do
72+
it "gets the resources" do
7373
subject.list
74-
a_get(request_path).with(:query => {:access_token => OAUTH_TOKEN}).
75-
should have_been_made
74+
expect(a_get(request_path).with(:query => {:access_token => OAUTH_TOKEN})).
75+
to have_been_made
7676
end
7777
end
7878
end # list

0 commit comments

Comments
 (0)