Skip to content

Commit

Permalink
Merge pull request #43 from mlarraz/type_fix
Browse files Browse the repository at this point in the history
Return same type after rescuing parser error
  • Loading branch information
hsbt authored Apr 21, 2018
2 parents 577b04c + 221bb88 commit 040b247
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ group :test do
gem 'backports'
gem 'coveralls'
gem 'rspec', '>= 3.1.0'
gem 'rubocop', '>= 0.50'
gem 'rubocop', '~> 0.52.1'
gem 'simplecov', '>= 0.9'
gem 'webmock'
gem 'yardstick'
Expand Down
2 changes: 1 addition & 1 deletion lib/gems/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def info(gem_name)
response = get("/api/v1/gems/#{gem_name}.json")
JSON.parse(response)
rescue JSON::ParserError
[]
{}
end

# Returns an array of active gems that match the query
Expand Down
2 changes: 1 addition & 1 deletion spec/gems/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
it 'returns some basic information about the given gem' do
info = Gems.info 'nonexistentgem'
expect(a_get('/api/v1/gems/nonexistentgem.json')).to have_been_made
expect(info).to eq []
expect(info['name']).to be_nil
end
end
end
Expand Down

0 comments on commit 040b247

Please sign in to comment.