Class: InfinityTest::Runner

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Runner

Returns a new instance of Runner.



5
6
7
8
# File 'lib/infinity_test/runner.rb', line 5

def initialize(argv)
  @options = Options.new(argv)
  @application = InfinityTest.application
end

Instance Attribute Details

#applicationObject (readonly)

Returns the value of attribute application.



3
4
5
# File 'lib/infinity_test/runner.rb', line 3

def application
  @application
end

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/infinity_test/runner.rb', line 3

def options
  @options
end

Instance Method Details

#list_heuristics!Object



20
21
22
23
24
25
# File 'lib/infinity_test/runner.rb', line 20

def list_heuristics!
  @application.heuristics.patterns.keys.each do |pattern|
    puts %{- "#{pattern}"}
  end
  exit
end

#load_configuration_file_or_read_the_options!Object



27
28
29
# File 'lib/infinity_test/runner.rb', line 27

def load_configuration_file_or_read_the_options!
  @application.load_configuration_file_or_read_the_options!(@options)
end

#run!Object



10
11
12
13
14
15
16
17
18
# File 'lib/infinity_test/runner.rb', line 10

def run!
  load_configuration_file_or_read_the_options!
  if @options[:show_heuristics?]
    list_heuristics!
  else
    @application.run_global_commands!
    start_continuous_testing!
  end
end

#start_continuous_testing!Object

Start Continuous Server using Watchr



33
34
35
# File 'lib/infinity_test/runner.rb', line 33

def start_continuous_testing!
  InfinityTest::ContinuousTesting.new.start!
end