Commit 6dc5dab7 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Configure RSpec from within RSpec runner class

parent a5ab2a5e
...@@ -9,7 +9,6 @@ module QA ...@@ -9,7 +9,6 @@ module QA
def perform(address, *files) def perform(address, *files)
Runtime::Scenario.define(:gitlab_address, address) Runtime::Scenario.define(:gitlab_address, address)
Specs::Config.perform
## ##
# Perform before hooks, which are different for CE and EE # Perform before hooks, which are different for CE and EE
......
...@@ -9,8 +9,6 @@ require 'selenium-webdriver' ...@@ -9,8 +9,6 @@ require 'selenium-webdriver'
module QA module QA
module Specs module Specs
class Config < Scenario::Template class Config < Scenario::Template
attr_writer :address
def perform def perform
configure_rspec! configure_rspec!
configure_capybara! configure_capybara!
...@@ -50,7 +48,6 @@ module QA ...@@ -50,7 +48,6 @@ module QA
end end
Capybara.configure do |config| Capybara.configure do |config|
# config.app_host = @address
config.default_driver = :chrome config.default_driver = :chrome
config.javascript_driver = :chrome config.javascript_driver = :chrome
config.default_max_wait_time = 4 config.default_max_wait_time = 4
......
...@@ -2,16 +2,14 @@ require 'rspec/core' ...@@ -2,16 +2,14 @@ require 'rspec/core'
module QA module QA
module Specs module Specs
class Runner class Runner < Scenario::Template
include Scenario::Actable def perform(tty: false, tags: [], files: ['qa/specs/features'])
def rspec(tty: false, tags: [], files: ['qa/specs/features'])
args = [] args = []
args << '--tty' if tty args.push('--tty') if tty
tags.to_a.each do |tag| tags.to_a.each { |tag| args.push(['-t', tag.to_s]) }
args << ['-t', tag.to_s] args.push(files)
end
args << files Specs::Config.perform
RSpec::Core::Runner.run(args.flatten, $stderr, $stdout).tap do |status| RSpec::Core::Runner.run(args.flatten, $stderr, $stdout).tap do |status|
abort if status.nonzero? abort if status.nonzero?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment