diff --git a/.gitmodules b/.gitmodules index 7f52fdb66..80bb4f695 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "vendor/rubocop"] - path = vendor/rubocop - url = git://github.com/bbatsov/rubocop.git + path = vendor/rubocop + url = https://github.com/bbatsov/rubocop.git diff --git a/.travis.yml b/.travis.yml index 513beb235..44a6438d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,32 @@ +sudo: false +cache: bundler language: ruby + rvm: - 1.9.3 - - 2.0.0 - - 2.1 + - 2.0.0-p648 + - 2.1.8 + - 2.2.4 + - 2.3.0 - ruby-head - jruby-19mode - - rbx-2 + - jruby-9.0.1.0 + - rbx-3 + +env: + # this doesn't do anything for MRI or RBX, but it doesn't hurt them either + # for JRuby, it enables us to get more accurate coverage data + - JRUBY_OPTS="--debug" + matrix: allow_failures: - rvm: ruby-head - - rvm: rbx-2 -before_install: - - gem update --remote bundler -script: - - bundle exec rake + - rvm: rbx-3 + fast_finish: true + +addons: + code_climate: + repo_token: 40adf93a016e2779eef43dce8f16ca10098ed9f498522e87c8bc94cf14f3e977 + +before_install: gem update --remote bundler +script: bundle exec rake diff --git a/Gemfile b/Gemfile index 9fc7dbeed..a873952f3 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,7 @@ source 'https://rubygems.org' gemspec group :test do - gem 'coveralls', require: false + gem 'codeclimate-test-reporter', require: false end local_gemfile = 'Gemfile.local' diff --git a/lib/rubocop/rspec/top_level_describe.rb b/lib/rubocop/rspec/top_level_describe.rb index 3c7f2e92d..0faacf803 100644 --- a/lib/rubocop/rspec/top_level_describe.rb +++ b/lib/rubocop/rspec/top_level_describe.rb @@ -26,7 +26,7 @@ def top_level_nodes nodes = describe_statement_children(root_node) # If we have no top level describe statements, we need to check any # blocks on the top level (e.g. after a require). - if nodes.size == 0 + if nodes.empty? nodes = node_children(root_node).map do |child| describe_statement_children(child) if child.type == :block end.flatten.compact diff --git a/rubocop-rspec.gemspec b/rubocop-rspec.gemspec index 49788715b..b378ef0f5 100644 --- a/rubocop-rspec.gemspec +++ b/rubocop-rspec.gemspec @@ -30,7 +30,7 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^spec/}) spec.extra_rdoc_files = ['MIT-LICENSE.md', 'README.md'] - spec.add_development_dependency('rubocop', '~> 0.36') + spec.add_development_dependency('rubocop', '0.37.1') spec.add_development_dependency('rake', '~> 10.1') spec.add_development_dependency('rspec', '~> 3.0') spec.add_development_dependency('simplecov', '~> 0.8') diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 770bdb376..ff84ea3f0 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -3,11 +3,18 @@ require 'rubocop' rubocop_path = File.join(File.dirname(__FILE__), '../vendor/rubocop') + unless File.directory?(rubocop_path) - fail "Can't run specs without a local RuboCop checkout. Look in the README." + raise "Can't run specs without a local RuboCop checkout. Look in the README." end + Dir["#{rubocop_path}/spec/support/**/*.rb"].each { |f| require f } +if ENV['CI'] + require 'codeclimate-test-reporter' + CodeClimate::TestReporter.start +end + RSpec.configure do |config| config.order = :random diff --git a/vendor/rubocop b/vendor/rubocop index 3ec1ef133..66c73b7da 160000 --- a/vendor/rubocop +++ b/vendor/rubocop @@ -1 +1 @@ -Subproject commit 3ec1ef13365b6ff70131e36d28765ad8afe44e74 +Subproject commit 66c73b7dadc15cbba427ffd4b41e11ae8e7eb146