Exception: BetterAssertDifference::DifferenceException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/better_assert_difference/exceptions/difference_exception.rb

Instance Method Summary collapse

Constructor Details

#initialize(difference) ⇒ DifferenceException

Returns a new instance of DifferenceException.



4
5
6
7
8
9
10
11
12
# File 'lib/better_assert_difference/exceptions/difference_exception.rb', line 4

def initialize(difference)
  super(
    <<~ERROR
      \nDifference is a #{difference}, it must be an integer.
      If you want to assert the difference of multiple expressions wrap them in an array:
      assert_difference [Foo, Bar], 1 { }
    ERROR
  )
end