Skip to content

Commit

Permalink
#75 fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Aug 18, 2024
1 parent 74865a3 commit 1786c10
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/fbe/award.rb
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def line(value, text)
end

def points
@lines.map { |l| l[:v] }.inject(&:+).to_i
@lines.map { |l| l[:v] }.inject(&:+).to_f.round.to_i
end

def greeting
Expand Down
1 change: 1 addition & 0 deletions test/fbe/test_award.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def test_some_terms

def test_some_greetings
{
'(award (give (times 7 0.25 "fun")))' => 'You\'ve earned +2 points. ',
'(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. ',
'(award (let x 0.1) (set b (times x 14)) (give b "fun"))' => 'You\'ve earned +1 points. '
Expand Down

0 comments on commit 1786c10

Please sign in to comment.