When I'm using ActiveSupport::TestCase tests that are failed shows message like this:
2) Failure:
ArrayTest#test_example [/Users/ironsand/dev/my_project/test/core_ext/array_test.rb:6]:
--- expected
+++ actual
@@ -1 +1 @@
-#<BigDecimal:7fb947c749a0,'0.94E0',9(18)>
+#<BigDecimal:7fb947c7f5a8,'0.95E0',9(45)>
I want to show the value 0.94 instead of <BigDecimal:7fb947c749a0,'0.94E0',9(18)>.
In rails cosole or in pry I'm using awesome_print.
Is there a way to activate awesome_print for result of the test?
I don't insist on using awesome_print, if there is another way to show the number more readable, I gonna happily use it.
You could add a message to to the assert statement
Also, you didn't ask this, but if you are trying to compare two decimal numbers, you probably want to use assert_in_delta to see that the numbers are close rather than exact.