summaryrefslogtreecommitdiff
path: root/qa/qa/specs/runner.rb
blob: 3cfe52b350cf326ad23ec9099b5552d311542599 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require 'rspec/core'

module QA
  module Specs
    class Runner < Scenario::Template
      def perform(tty: false, tags: [], files: ['qa/specs/features'])
        args = []
        args.push('--tty') if tty
        tags.to_a.each { |tag| args.push(['-t', tag.to_s]) }
        args.push(files)

        Specs::Config.perform

        RSpec::Core::Runner.run(args.flatten, $stderr, $stdout).tap do |status|
          abort if status.nonzero?
        end
      end
    end
  end
end