Module: Assert

Includes:
Options
Defined in:
lib/assert/test.rb,
lib/assert/macro.rb,
lib/assert/suite.rb,
lib/assert/result.rb,
lib/assert/runner.rb,
lib/assert/autorun.rb,
lib/assert/context.rb,
lib/assert/options.rb,
lib/assert/version.rb,
lib/assert/assertions.rb,
lib/assert/rake_tasks.rb,
lib/assert/result_set.rb,
lib/assert/setup/view.rb,
lib/assert/setup/suite.rb,
lib/assert/setup/runner.rb,
lib/assert/setup/helpers.rb,
lib/assert/setup/options.rb

Defined Under Namespace

Modules: Assertions, Helpers, Macros, Options, RakeTasks, Result Classes: AnsiTerminal, Context, Macro, ResultSet, Runner, Suite, Test

Constant Summary collapse

VERSION =
"0.5.0"

Class Method Summary collapse

Methods included from Options

included

Class Method Details

.autorunObject

install at_exit hook (if needed) (runs at process exit) this ensures the test suite won’t run unitl all test files are loaded (this is essentially a direct rip from Minitest)



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/assert/autorun.rb', line 13

def autorun
  at_exit do
    # don't run if there was an exception
    next if $!

    # the order here is important. The at_exit handler must be
    # installed before anyone else gets a chance to install their
    # own, that way we can be assured that our exit will be last
    # to run (at_exit stacks).

    exit_code = nil
    at_exit { exit(false) if exit_code && exit_code != 0 }
    self.runner.new(self.suite, self.view).run
  end unless @@at_exit_installed
  @@at_exit_installed = true
end

.runnerObject



11
# File 'lib/assert/setup/runner.rb', line 11

def runner; self.options.runner; end

.suiteObject



11
12
13
# File 'lib/assert/setup/suite.rb', line 11

def suite
  self.options.suite
end

.viewObject



31
# File 'lib/assert/setup/view.rb', line 31

def view; self.options.view; end