Rakefile in rails-session_cookie-0.2.2 vs Rakefile in rails-session_cookie-0.3.0
- old
+ new
@@ -1,34 +1,15 @@
+# frozen_string_literal: true
+
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
-require 'codeclimate-test-reporter'
RSpec::Core::RakeTask.new(:spec)
-RuboCop::RakeTask.new(:rubocop)
+RuboCop::RakeTask.new
-# Same as bin/codeclimate-test-reporter, but don't complain if no coverage found
-task :coverage do
- exit unless ENV['CI']
-
- repo_token = ENV['CODECLIMATE_REPO_TOKEN']
- if repo_token.nil? || repo_token.empty?
- STDERR.puts 'Cannot post results: environment variable CODECLIMATE_REPO_TOKEN must be set.'
- exit
- end
-
- COVERAGE_FILE = ARGV.first || 'coverage/.resultset.json'
- unless File.exist?(COVERAGE_FILE)
- STDERR.puts 'Coverage results not found'
- exit
- end
-
- begin
- results = JSON.parse(File.read(COVERAGE_FILE))
- rescue JSON::ParserError => e
- abort "Error encountered while parsing #{COVERAGE_FILE}: #{e}"
- end
-
- CodeClimate::TestReporter.run(results)
+RSpec::Core::RakeTask.new(:spec_github) do |t|
+ t.rspec_opts = '--format RSpec::Github::Formatter -f documentation'
end
-task default: %i[rubocop spec coverage]
+task ci: %i[rubocop spec_github]
+task default: %i[rubocop spec]