Module: PowerAssert

Defined in:
lib/power_assert.rb,
lib/power_assert/version.rb

Constant Summary collapse

VERSION =
"0.3.0"

Class Method Summary collapse

Class Method Details

.configurationObject



24
25
26
# File 'lib/power_assert.rb', line 24

def configuration
  @configuration ||= Configuration[false, false]
end

.configure {|configuration| ... } ⇒ Object

Yields:



28
29
30
# File 'lib/power_assert.rb', line 28

def configure
  yield configuration
end

.start(assertion_proc_or_source, assertion_method: nil, source_binding: TOPLEVEL_BINDING) {|Context.new(assertion_proc_or_source, assertion_method, source_binding)| ... } ⇒ Object

Yields:

  • (Context.new(assertion_proc_or_source, assertion_method, source_binding))


32
33
34
35
36
37
# File 'lib/power_assert.rb', line 32

def start(assertion_proc_or_source, assertion_method: nil, source_binding: TOPLEVEL_BINDING)
  if respond_to?(:clear_global_method_cache, true)
    clear_global_method_cache
  end
  yield Context.new(assertion_proc_or_source, assertion_method, source_binding)
end