Class: Assert::Runner

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

Instance Method Summary collapse

Constructor Details

#initialize(suite, view) ⇒ Runner

a Runner runs a suite of tests.

Raises:

  • (ArgumentError)


8
9
10
11
12
# File 'lib/assert/runner.rb', line 8

def initialize(suite, view)
  raise ArgumentError if !suite.kind_of?(Suite)
  @suite = suite
  @view = view
end

Instance Method Details

#count(type) ⇒ Object



23
24
25
# File 'lib/assert/runner.rb', line 23

def count(type)
  @suite.count(type)
end

#run(*args) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/assert/runner.rb', line 14

def run(*args)
  @suite.setup
  @view.render do
    benchmark { run_suite }
  end
  @suite.teardown
  count(:failed) + count(:errored)
end