2019-10-29 17:08:37 +03:00
|
|
|
require_relative './helper'
|
|
|
|
|
|
|
|
class VerboseFormatterTest < Test::Unit::TestCase
|
|
|
|
def setup
|
|
|
|
require_relative File.join(DidYouMean::TestHelper.root, 'verbose')
|
2020-05-23 00:17:10 +03:00
|
|
|
|
2020-02-09 12:34:47 +03:00
|
|
|
DidYouMean.formatter = DidYouMean::VerboseFormatter.new
|
2019-10-29 17:08:37 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
def teardown
|
|
|
|
DidYouMean.formatter = DidYouMean::PlainFormatter.new
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_message
|
|
|
|
@error = assert_raise(NoMethodError){ 1.zeor? }
|
|
|
|
|
2019-12-01 06:29:02 +03:00
|
|
|
assert_match <<~MESSAGE.strip, @error.message
|
2019-10-29 17:08:37 +03:00
|
|
|
undefined method `zeor?' for 1:Integer
|
|
|
|
|
|
|
|
Did you mean? zero?
|
|
|
|
MESSAGE
|
|
|
|
end
|
|
|
|
end
|