slack-notifier/slack-notifier

View on GitHub
bin/test

Summary

Maintainability
Test Coverage
#!/usr/bin/env ruby

require 'yaml'
YAML.load_file('.env').each do |key, var|
  ENV[key] = var
end

rubies = ['2.0.0', '2.1', '2.2', '2.3.3', '2.4.0']
rubies.each do |ruby|
  # cleanup gemfile.locks
  Dir['spec*/**/*.lock'].each do |lockfile|
    puts "removing #{lockfile}"
    system "rm #{lockfile}"
  end

  pid = Process.fork do
    exec "rvm #{ruby} do ruby spec/integration/ping_integration_test.rb"
  end

  trap 'INT' do
    puts 'exiting'
    pid.send(:exit)
  end

  Process.wait(pid)
end