Skip to content

Commit

Permalink
Merge pull request #36 from chrishunt/update-rspec
Browse files Browse the repository at this point in the history
Update rspec to v3.0.0
  • Loading branch information
chrishunt committed Jul 15, 2014
2 parents 1c86c8d + 995d876 commit 319ba13
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion github-auth.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'mute', '~> 1.1.0'
spec.add_development_dependency 'pry', '~> 0.9.12.6'
spec.add_development_dependency 'rake', '~> 10.3.2'
spec.add_development_dependency 'rspec', '~> 2.14.1'
spec.add_development_dependency 'rspec', '~> 3.0.0'
spec.add_development_dependency 'sinatra', '~> 1.4.5'
spec.add_development_dependency 'thin', '~> 1.6.2'

Expand Down
10 changes: 5 additions & 5 deletions spec/unit/github/auth/keys_client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
})
}

before { subject.stub(http_client: http_client) }
before { allow(subject).to receive(:http_client).and_return(http_client) }

describe '#initialize' do
it 'requires a username' do
Expand All @@ -42,15 +42,15 @@

describe '#keys' do
it 'requests keys from the Github API' do
http_client.should_receive(:get).with(
expect(http_client).to receive(:get).with(
"https://api.github.com/users/#{username}/keys",
{ headers: { 'User-Agent' => "github_auth-#{Github::Auth::VERSION}" } }
)
subject.keys
end

it 'memoizes the response' do
http_client.should_receive(:get).once
expect(http_client).to receive(:get).once
2.times { subject.keys }
end

Expand Down Expand Up @@ -89,8 +89,8 @@

context 'when there is an issue connecting to Github' do
before do
http_client
.stub(:get)
expect(http_client)
.to receive(:get)
.and_raise Faraday::Error::ConnectionFailed.new('Oops!')
end

Expand Down

0 comments on commit 319ba13

Please sign in to comment.