Class: Mocha::Deprecation

Inherits:
Object show all
Defined in:
lib/mocha/deprecation.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.messagesObject

Returns the value of attribute messages


7
8
9
# File 'lib/mocha/deprecation.rb', line 7

def messages
  @messages
end

.modeObject

Returns the value of attribute mode


7
8
9
# File 'lib/mocha/deprecation.rb', line 7

def mode
  @mode
end

Class Method Details

.warning(message) ⇒ Object


9
10
11
12
13
# File 'lib/mocha/deprecation.rb', line 9

def warning(message)
  @messages << message
  $stderr.puts "Mocha deprecation warning: #{message}" unless mode == :disabled
  $stderr.puts caller.join("\n  ") if mode == :debug
end