Class: FlakyTester

Inherits:
Object
  • Object
show all
Defined in:
lib/flaky_tester.rb,
lib/flaky_tester/test_runner.rb,
lib/flaky_tester/command_parser.rb,
lib/flaky_tester/results_parser.rb,
lib/flaky_tester/errors/rspec_error.rb,
lib/flaky_tester/errors/unknown_path.rb,
lib/flaky_tester/errors/invalid_times.rb

Defined Under Namespace

Modules: Errors Classes: CommandParser, ResultsParser, TestRunner

Constant Summary collapse

DEFAULT_OPTIONS =
{
  times: 25,
  path: ""
}.freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.test(args = []) ⇒ Object



11
12
13
# File 'lib/flaky_tester.rb', line 11

def self.test(args = [])
  new.test(args)
end

Instance Method Details

#test(args) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/flaky_tester.rb', line 15

def test(args)
  command_parser = CommandParser.new
  options = command_parser.parse(args)

  test_runner = TestRunner.new
  results = test_runner.run(options)

  results_parser = ResultsParser.new
  message = results_parser.parse(results)

  puts(message)
rescue => error
  puts(error)
  puts(command_parser)
rescue SystemExit
  # do nothing
end