Exception: STesterException

Inherits:
Exception
  • Object
show all
Defined in:
lib/s_tester_exception.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, comparator, expected_result) ⇒ STesterException

Returns a new instance of STesterException.



5
6
7
# File 'lib/s_tester_exception.rb', line 5

def initialize value, comparator, expected_result
  @value, @comparator, @expected_result = value, comparator, expected_result
end

Instance Attribute Details

#comparatorObject (readonly)

Returns the value of attribute comparator.



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

def comparator
  @comparator
end

#expected_resultObject (readonly)

Returns the value of attribute expected_result.



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

def expected_result
  @expected_result
end

#valueObject (readonly)

Returns the value of attribute value.



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

def value
  @value
end

Instance Method Details

#messageObject



9
10
11
# File 'lib/s_tester_exception.rb', line 9

def message
  "Sorry bro, #{value} is not #{comparator} to #{expected_result}. Fix it!"
end