Module: Assert

Defined in:
lib/assert.rb,
lib/assert/cli.rb,
lib/assert/stub.rb,
lib/assert/test.rb,
lib/assert/view.rb,
lib/assert/clirb.rb,
lib/assert/macro.rb,
lib/assert/suite.rb,
lib/assert/utils.rb,
lib/assert/config.rb,
lib/assert/result.rb,
lib/assert/runner.rb,
lib/assert/context.rb,
lib/assert/factory.rb,
lib/assert/version.rb,
lib/assert/file_line.rb,
lib/assert/assertions.rb,
lib/assert/actual_value.rb,
lib/assert/context_info.rb,
lib/assert/default_view.rb,
lib/assert/view_helpers.rb,
lib/assert/assert_runner.rb,
lib/assert/default_suite.rb,
lib/assert/config_helpers.rb,
lib/assert/default_runner.rb,
lib/assert/context/let_dsl.rb,
lib/assert/context/test_dsl.rb,
lib/assert/context/setup_dsl.rb,
lib/assert/context/suite_dsl.rb,
lib/assert/context/subject_dsl.rb,
lib/assert/context/method_missing.rb

Defined Under Namespace

Modules: Assertions, ConfigHelpers, Factory, Macros, Result, RoundedMillisecondTime, Utils, ViewHelpers Classes: ActualValue, AssertRunner, CLI, CLIRB, Config, Context, ContextInfo, DefaultRunner, DefaultSuite, DefaultView, FileLine, Macro, Runner, StubCall, StubCallSpy, Suite, Test, View

Constant Summary collapse

U =

alias for brevity

Utils
VERSION =
"2.19.5"

Class Method Summary collapse

Class Method Details

.configObject



14
15
16
# File 'lib/assert.rb', line 14

def self.config
  @config ||= Config.new
end

.configure {|config| ... } ⇒ Object

Yields:



18
19
20
# File 'lib/assert.rb', line 18

def self.configure
  yield config if block_given?
end

.runnerObject



30
31
32
# File 'lib/assert.rb', line 30

def self.runner
  config.runner
end

.stub(*args, &block) ⇒ Object



10
11
12
# File 'lib/assert/stub.rb', line 10

def self.stub(*args, &block)
  MuchStub.stub(*args, &block)
end

.stub_on_call(*args, &block) ⇒ Object



14
15
16
# File 'lib/assert/stub.rb', line 14

def self.stub_on_call(*args, &block)
  MuchStub.stub_on_call(*args, &block)
end

.stub_send(*args, &block) ⇒ Object



26
27
28
29
30
31
32
33
34
# File 'lib/assert/stub.rb', line 26

def self.stub_send(*args, &block)
  orig_caller = caller_locations
  begin
    MuchStub.stub_send(*args, &block)
  rescue MuchStub::NotStubbedError => ex
    ex.set_backtrace(orig_caller.map(&:to_s))
    raise ex
  end
end

.stub_spy(*args, &block) ⇒ Object



44
45
46
# File 'lib/assert/stub.rb', line 44

def self.stub_spy(*args, &block)
  MuchStub.spy(*args, &block)
end

.stub_tap(*args, &block) ⇒ Object



36
37
38
# File 'lib/assert/stub.rb', line 36

def self.stub_tap(*args, &block)
  MuchStub.tap(*args, &block)
end

.stub_tap_on_call(*args, &block) ⇒ Object



40
41
42
# File 'lib/assert/stub.rb', line 40

def self.stub_tap_on_call(*args, &block)
  MuchStub.tap_on_call(*args, &block)
end

.stubsObject



6
7
8
# File 'lib/assert/stub.rb', line 6

def self.stubs
  MuchStub.stubs
end

.suiteObject



26
27
28
# File 'lib/assert.rb', line 26

def self.suite
  config.suite
end

.unstub(*args) ⇒ Object



18
19
20
# File 'lib/assert/stub.rb', line 18

def self.unstub(*args)
  MuchStub.unstub(*args)
end

.unstub!Object



22
23
24
# File 'lib/assert/stub.rb', line 22

def self.unstub!
  MuchStub.unstub!
end

.viewObject



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

def self.view
  config.view
end