Module: Assert

Includes:
Options
Defined in:
lib/assert/cli.rb,
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, View Classes: CLI, CLIRB, CLIRunner, Context, Macro, ResultSet, Runner, Suite, Test

Constant Summary collapse

VERSION =
"1.1.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 until all test files are loaded (this is essentially a direct rip from Minitest)



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/assert/autorun.rb', line 12

def self.autorun
  if !@@at_exit_installed
    self.view.fire(:before_load)

    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.view.fire(:after_load)
      self.runner.new(self.suite, self.view).run
    end

    @@at_exit_installed = true
  end
end

.runnerObject



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

def self.runner; self.options.runner; end

.suiteObject



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

def self.suite; self.options.suite; end

.viewObject



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

def self.view; self.options.view; end