Class: Expectations::StandardError

Inherits:
Object
  • Object
show all
Defined in:
lib/expectations/standard_error.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.outletObject

Returns the value of attribute outlet.



3
4
5
# File 'lib/expectations/standard_error.rb', line 3

def outlet
  @outlet
end

Class Method Details



12
13
14
15
# File 'lib/expectations/standard_error.rb', line 12

def self.print(string)
  print_suggestion
  outlet.print string
end


17
18
19
20
21
# File 'lib/expectations/standard_error.rb', line 17

def self.print_suggestion
  return if @suggestion_printed
  @suggestion_printed = true
  outlet.print "Expectations allows you to to create multiple mock expectations, but suggests that you write another test instead.\n"
end

.silenceObject



8
9
10
# File 'lib/expectations/standard_error.rb', line 8

def self.silence
  self.outlet = Silent
end