diff --git a/lib/fbe/award.rb b/lib/fbe/award.rb index 054a6bb..1545ac5 100644 --- a/lib/fbe/award.rb +++ b/lib/fbe/award.rb @@ -253,7 +253,7 @@ def to_s # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity when :min "minimum of #{to_p(@operands[0])} and #{to_p(@operands[1])}" when :between - "at least #{to_p(@operands[0])} and at most #{to_p(@operands[1])}" + "#{to_p(@operands[0])} clamped between #{to_p(@operands[1])} and #{to_p(@operands[2])}" else raise(Fbe::Error, "Unknown term '#{@op}'") end diff --git a/test/fbe/test_award.rb b/test/fbe/test_award.rb index cf3bb50..1e38ced 100644 --- a/test/fbe/test_award.rb +++ b/test/fbe/test_award.rb @@ -114,6 +114,11 @@ def test_some_policies end end + def test_between_bylaw_mentions_value_and_both_bounds + md = Fbe::Award.new('(award (set b (between b 3 120)))').bylaw.markdown + assert_includes(md, 'set _b_ to _b_ clamped between **3** and **120**', md) + end + def test_shorten_when_one_number g = Fbe::Award.new('(award (give 23 "for love"))').bill.greeting assert_equal('You\'ve earned +23 points. ', g, g)