Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/fbe/award.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
require 'factbase/syntax'
require 'joined'
require_relative 'fb'
require_relative 'pmp'

# A generator of awards.
#
Expand Down
15 changes: 15 additions & 0 deletions test/fbe/test_award.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 Zerocracy
# SPDX-License-Identifier: MIT

require 'factbase'
require 'judges/options'
require 'loog'
require_relative '../../lib/fbe/award'
require_relative '../test__helper'
Expand Down Expand Up @@ -60,6 +62,19 @@ def test_simple
].each { |t| assert_includes(md, t, md) }
end

def test_reads_bylaw_from_pmp_when_no_query
$fb = Factbase.new
$global = {}
$options = Judges::Options.new
$loog = Loog::NULL
f = $fb.insert
f.what = 'pmp'
f.area = 'hr'
f.bug_report_was_rewarded = '(award (give 7 "as a basis"))'
a = Fbe::Award.new(judge: 'bug-report-was-rewarded')
assert_equal(7, a.bill.points, 'the bylaw was not read from the PMP')
end

def test_let_publishes_the_value_of_an_expression
md = Fbe::Award.new(
'(award (explain "t") (let x (plus 2 3)) (aka (give 1 "for x=${x}") "award ${x} points"))'
Expand Down
Loading