From c0c4ba5e62abd2a54468ba2b865264b380c004df Mon Sep 17 00:00:00 2001 From: Jelani Woods Date: Mon, 17 Oct 2022 19:11:07 -0500 Subject: [PATCH] Improve spec error messages --- spec/scripts/float_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/scripts/float_spec.rb b/spec/scripts/float_spec.rb index 8ec534e..30b53c9 100644 --- a/spec/scripts/float_spec.rb +++ b/spec/scripts/float_spec.rb @@ -12,7 +12,7 @@ output = with_captured_stdout { require_relative('../../float_find_hypotenuse')} output = "empty" if output.empty? expect(output.match?(/5.3/i)).to be(true), - "Expected float_find_hypotenuse.rb output to be '5.3\n', but was #{output}." + "Expected float_find_hypotenuse.rb output to be:\n5.3\nbut was:\n#{output}" end end @@ -32,7 +32,7 @@ output = with_captured_stdout { require_relative('../../float_round')} output = "empty" if output.empty? expect(output.match?(/3.333\n/i)).to be(true), - "Expected float_round.rb output to be '3.333\n', but was #{output}." + "Expected float_round.rb output to be\n3.333\nbut was\n#{output}" end end