Sha256: 5b1d9d74361d8d4b1aecaefbe3b7ffc9a5c383acccd6584e135eb4e7bd7a6d59

Contents?: true

Size: 1.17 KB

Versions: 2

Compression:

Stored size: 1.17 KB

Contents

require 'omnitest/command'

require 'benchmark'

module Omnitest
  module Command
    # Command to test one or more instances.
    class Test < Omnitest::Command::Base
      include RunAction

      # Invoke the command.
      def call
        banner "Starting Omnitest (v#{Omnitest::VERSION})"
        scenarios = nil
        elapsed = Benchmark.measure do
          setup
          scenarios = parse_subcommand(args.shift, args.shift)

          run_action(scenarios, :test, options[:concurrency])
        end
        banner "Omnitest is finished. #{Core::Util.duration(elapsed.real)}"
        test_summary(scenarios)
      end

      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
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
omnitest-0.2.2 lib/omnitest/command/test.rb
omnitest-0.2.1 lib/omnitest/command/test.rb