Skip to content

Commit e07786a

Browse files
authored
Merge pull request #140 from oauth-xx/upgrade_code_climate
Upgrade Code Climate and fixing tests
2 parents e397b3e + d49353e commit e07786a

28 files changed

+63
-48
lines changed

.travis.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
1-
addons:
2-
apt:
3-
packages:
4-
- libcurl-dev
5-
61
language: ruby
72

8-
before_install: rvm rubygems master --force
9-
install: gem install --file
10-
script: "RUBYGEMS_GEMDEPS=- rake test"
11-
123
rvm:
13-
- "2.3.0"
4+
- "ruby-head"
5+
- "2.4.0"
6+
- "2.3"
147
- "2.2"
158
- "2.1"
169
- "2.0"
1710

1811
addons:
1912
code_climate:
2013
repo_token: 8f697ca756250f0c2c54170ae27e8a9c459d18a0236903b11291c88291b3aac9
14+
15+
after_success:
16+
- bundle exec codeclimate-test-reporter

Gemfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
source 'https://rubygems.org'
22

33
gemspec
4-
5-
group :test do
6-
gem "codeclimate-test-reporter", require: nil
7-
end

HISTORY

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
=== CURRENT
2+
3+
* Adding support to Ruby 2.4 and head (James Pinto)
4+
* Upgrading to CodeClimate 1.0 (James Pinto)
5+
* Nokogiri 1.7 does not accept Ruby 2.0 (James Pinto)
6+
17
=== 0.5.1 2016-02-29
28

39
* Proper handling for empty query string in RequestToken#build_authorize_url (midchildan,

oauth.gemspec

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ Gem::Specification.new do |spec|
1919
spec.test_files = Dir.glob("test/**/*.rb")
2020
spec.extra_rdoc_files = [ "LICENSE", "README.rdoc", "TODO" ]
2121

22+
# This gem will work with 2.0 or greater...
23+
spec.required_ruby_version = '>= 2.0'
24+
25+
# Nokogiri 1.7 does not accept Ruby 2.0
26+
spec.add_development_dependency("nokogiri", "~> 1.6.8") if RUBY_VERSION < "2.1"
27+
2228
spec.add_development_dependency("rake")
2329
spec.add_development_dependency("minitest")
2430
spec.add_development_dependency("byebug")
@@ -31,4 +37,6 @@ Gem::Specification.new do |spec|
3137
spec.add_development_dependency("em-http-request", "0.2.11")
3238
spec.add_development_dependency("curb")
3339
spec.add_development_dependency("webmock", "< 2.0")
40+
spec.add_development_dependency("codeclimate-test-reporter")
41+
spec.add_development_dependency("simplecov")
3442
end

test/test_helper.rb

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
1+
# ensure test env
2+
13
ENV['RACK_ENV'] = 'test'
24

3-
require "codeclimate-test-reporter"
4-
CodeClimate::TestReporter.start
5+
# simplecov, Travis will call codeclimate
6+
7+
require 'simplecov'
8+
SimpleCov.start
9+
10+
# require third-party code
511

6-
require 'rubygems'
12+
require 'byebug'
13+
require 'stringio'
714
require 'minitest/autorun'
815
require 'mocha/mini_test'
916
require 'rack/test'
17+
require 'webmock/minitest'
1018

11-
require 'byebug'
19+
# require our lib
1220

1321
$LOAD_PATH << File.dirname(__FILE__) + '/../lib/'
1422
require 'oauth'
15-
require 'stringio'
16-
require 'webmock/minitest'
17-
WebMock.disable_net_connect!(allow: "codeclimate.com")
23+
24+
# require our support code
1825

1926
require 'support/minitest_helpers'

test/test_helper_units.rb

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/units/test_access_token.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require File.expand_path('../../test_helper_units', __FILE__)
1+
require File.expand_path('../../test_helper', __FILE__)
22

33
class TestAccessToken < Minitest::Test
44
def setup

test/units/test_action_controller_request_proxy.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require File.expand_path('../../test_helper_units', __FILE__)
1+
require File.expand_path('../../test_helper', __FILE__)
22

33
require 'oauth/request_proxy/action_controller_request'
44

test/units/test_cli.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require File.expand_path('../../test_helper_units', __FILE__)
1+
require File.expand_path('../../test_helper', __FILE__)
22

33
require 'oauth/cli'
44

test/units/test_consumer.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
require File.expand_path('../../test_helper_units', __FILE__)
2-
3-
require 'stringio'
1+
require File.expand_path('../../test_helper', __FILE__)
42

53
# This performs testing against Andy Smith's test server http://term.ie/oauth/example/
64
# Thanks Andy.

0 commit comments

Comments
 (0)