2019-10-29 10:08:37 -04:00
|
|
|
require_relative './helper'
|
|
|
|
|
|
|
|
class VerboseFormatterTest < Test::Unit::TestCase
|
|
|
|
def setup
|
|
|
|
require_relative File.join(DidYouMean::TestHelper.root, 'verbose')
|
|
|
|
end
|
|
|
|
|
|
|
|
def teardown
|
|
|
|
DidYouMean.formatter = DidYouMean::PlainFormatter.new
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_message
|
|
|
|
@error = assert_raise(NoMethodError){ 1.zeor? }
|
|
|
|
|
2019-11-30 22:24:50 -05:00
|
|
|
assert_equal <<~MESSAGE.strip, @error.message.strip
|
2019-10-29 10:08:37 -04:00
|
|
|
undefined method `zeor?' for 1:Integer
|
|
|
|
|
|
|
|
Did you mean? zero?
|
2019-11-30 21:08:39 -05:00
|
|
|
|
2019-10-29 10:08:37 -04:00
|
|
|
MESSAGE
|
|
|
|
end
|
|
|
|
end
|