2022-01-28 02:59:24 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2009-09-03 01:32:57 +00:00
|
|
|
require 'rubygems'
|
2011-07-22 21:33:18 +00:00
|
|
|
require 'bundler'
|
|
|
|
Bundler.setup
|
2009-09-03 01:32:57 +00:00
|
|
|
|
2011-07-22 21:33:18 +00:00
|
|
|
Bundler::GemHelper.install_tasks
|
2010-06-22 14:07:35 +00:00
|
|
|
|
2011-01-27 14:20:39 +00:00
|
|
|
require 'rspec/core/rake_task'
|
|
|
|
RSpec::Core::RakeTask.new do |spec|
|
2009-09-03 01:32:57 +00:00
|
|
|
spec.pattern = 'spec/**/*_spec.rb'
|
2017-01-31 17:09:25 +00:00
|
|
|
spec.exclude_pattern = 'spec/integration/**/*_spec.rb'
|
2009-09-03 01:32:57 +00:00
|
|
|
end
|
|
|
|
|
2014-03-31 00:44:13 +00:00
|
|
|
require 'rubocop/rake_task'
|
2014-07-06 21:56:20 +00:00
|
|
|
RuboCop::RakeTask.new(:rubocop)
|
2014-03-31 00:44:13 +00:00
|
|
|
|
2017-02-03 18:09:04 +00:00
|
|
|
require_relative 'spec/support/integration_specs'
|
|
|
|
task :integration_specs do
|
|
|
|
next if ENV['CI']
|
2022-01-28 02:59:24 +00:00
|
|
|
|
2017-02-03 18:09:04 +00:00
|
|
|
status_codes = []
|
|
|
|
handler = lambda do |status_code|
|
|
|
|
status_codes << status_code unless status_code.zero?
|
|
|
|
end
|
|
|
|
|
|
|
|
run_all_integration_specs(handler: handler, logger: ->(msg) { puts msg })
|
|
|
|
|
|
|
|
if status_codes.any?
|
2018-02-03 16:23:14 +00:00
|
|
|
warn "#{status_codes.size} integration test(s) failed"
|
2017-02-03 18:09:04 +00:00
|
|
|
exit status_codes.last
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-02-03 16:23:14 +00:00
|
|
|
task default: %i[rubocop spec integration_specs]
|