Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Aug 3, 2024
1 parent 2f21bbb commit e055674
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/fbe/test_award.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit e055674

Please sign in to comment.