summaryrefslogtreecommitdiff
path: root/Rakefile
blob: 754418583e95ab7ab6544ed843877c46619d0e24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
require 'rubygems'
require 'bundler'
Bundler.setup

Bundler::GemHelper.install_tasks

require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new do |spec|
  spec.pattern = 'spec/**/*_spec.rb'
  spec.exclude_pattern = 'spec/integration/**/*_spec.rb'
end

require 'rubocop/rake_task'
RuboCop::RakeTask.new(:rubocop)

require_relative 'spec/support/integration_specs'
task :integration_specs do
  next if ENV['CI']
  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?
    warn "#{status_codes.size} integration test(s) failed"
    exit status_codes.last
  end
end

task default: %i[rubocop spec integration_specs]