Class: Omnitest::Command::Test
- Includes:
- RunAction
- Defined in:
- lib/omnitest/command/test.rb
Overview
Command to test one or more instances.
Instance Method Summary collapse
-
#call ⇒ Object
Invoke the command.
- #test_summary(scenarios) ⇒ Object
Methods included from RunAction
Methods inherited from Base
Constructor Details
This class inherits a constructor from Omnitest::Command::Base
Instance Method Details
#call ⇒ Object
Invoke the command.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/omnitest/command/test.rb', line 12 def call "Starting Omnitest (v#{Omnitest::VERSION})" scenarios = nil elapsed = Benchmark.measure do setup scenarios = parse_subcommand(args.shift, args.shift) run_action(scenarios, :test, [:concurrency]) end "Omnitest is finished. #{Core::Util.duration(elapsed.real)}" test_summary(scenarios) end |
#test_summary(scenarios) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/omnitest/command/test.rb', line 25 def test_summary(scenarios) # TODO: Need an actual test summary failed_scenarios = scenarios.select do | s | !s.status_description.match(/Fully Verified|<Not Found>/) end shell.say failed_scenarios.each do | scenario | shell.say_status scenario.status_description, scenario.slug end status_line = "#{scenarios.size} scenarios, #{failed_scenarios.size} failures" # , x pending shell.say status_line abort unless failed_scenarios.empty? end |