Parent

Files

Mocha::Configuration

Configuration settings

Constants

DEFAULTS

Public Class Methods

allow(action, &block) click to toggle source

Allow the specified action (as a symbol). The actions currently available are :stubbing_method_unnecessarily, :stubbing_method_on_non_mock_object, :stubbing_non_existent_method, :stubbing_non_public_method. If given a block, the configuration for the action will only be changed for the duration of the block, and will then be restored to the previous value.

# File lib/mocha/configuration.rb, line 15
def allow(action, &block)
  change_config action, :allow, &block
end
prevent(action, &block) click to toggle source

Raise a StubbingError if the specified action (as a symbol) is attempted. The actions currently available are :stubbing_method_unnecessarily, :stubbing_method_on_non_mock_object, :stubbing_non_existent_method, :stubbing_non_public_method. If given a block, the configuration for the action will only be changed for the duration of the block, and will then be restored to the previous value.

# File lib/mocha/configuration.rb, line 41
def prevent(action, &block)
  change_config action, :prevent, &block
end
warn_when(action, &block) click to toggle source

Warn if the specified action (as a symbol) is attempted. The actions currently available are :stubbing_method_unnecessarily, :stubbing_method_on_non_mock_object, :stubbing_non_existent_method, :stubbing_non_public_method. If given a block, the configuration for the action will only be changed for the duration of the block, and will then be restored to the previous value.

# File lib/mocha/configuration.rb, line 28
def warn_when(action, &block)
  change_config action, :warn, &block
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.