Class: Quintocumber::Cli::Main

Inherits:
Object
  • Object
show all
Defined in:
lib/quintocumber.rb

Overview

CLI entrypoint class

Instance Method Summary collapse

Constructor Details

#initialize(args, _ = nil, out = STDOUT, err = STDERR, kernel = Kernel) ⇒ Main

Returns a new instance of Main.



10
11
12
13
14
15
# File 'lib/quintocumber.rb', line 10

def initialize(args, _ = nil, out = STDOUT, err = STDERR, kernel = Kernel)
  @args   = args
  @out    = out
  @err    = err
  @kernel = kernel
end

Instance Method Details

#default_args(loader_file) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/quintocumber.rb', line 29

def default_args(loader_file)
  [
    '--format',
    'pretty',
    '--format',
    'AllureCucumber::Formatter',
    '--out',
    'reports',
    '--require',
    loader_file.to_s
  ]
end

#execute!Object



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/quintocumber.rb', line 17

def execute!
  if ENV['TESTS']
    require 'setup_tests/coverage'
    require 'setup_tests/mocks'
  end
  loader_file = File.join(File.dirname(__FILE__), '/loader.rb')
  args = default_args(loader_file) + @args
  
  runtime = Cucumber::Runtime.new 
  Cucumber::Cli::Main.new(args, nil, @out, @err, @kernel).execute!(runtime)
end