From e055674b7a9b8e709ae61e9f2e6aa650e6b2dce4 Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Sat, 3 Aug 2024 20:12:38 +0300 Subject: [PATCH] tests --- test/fbe/test_award.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/fbe/test_award.rb b/test/fbe/test_award.rb index b761da8..59842de 100644 --- a/test/fbe/test_award.rb +++ b/test/fbe/test_award.rb @@ -81,6 +81,7 @@ def test_simple def test_some_terms { '(let x 25)' => 0, + '(award (give (times 5 0.25 "fun")))' => 1, '(award (give 25 "for being a good boy"))' => 25, '(award (give (between 42 -10 -50) "empty"))' => -10, '(award (give (between -3 -10 -50) "empty"))' => 0, @@ -91,6 +92,16 @@ def test_some_terms end end + def test_some_greetings + { + '(award (give (times 5 0.25 "fun")))' => 'You\'ve earned +1 points. ', + '(award (give 25 "for being a good boy"))' => 'You\'ve earned +25 points. ' + }.each do |q, v| + a = Fbe::Award.new(q) + assert_equal(v, a.bill.greeting, q) + end + end + def test_must_not_give_anything_when_too_small_value { '(award (give (between 0 5 20)))' => 0,