Skip to content

Commit

Permalink
SaiFicSkillTableのcommand_patternがRuby依存にならないように
Browse files Browse the repository at this point in the history
  • Loading branch information
ysakasin committed Mar 28, 2021
1 parent 90d9211 commit 1eb03a9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bcdice/dice_table/sai_fic_skill_table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def roll_skill(randomizer)
end

def prefixes
([/RTT[1-6]?/i, "RCT", @rtt, @rct] + @rttn).compact
(["RTT[1-6]?", "RCT", @rtt, @rct] + @rttn).compact
end

private
Expand Down
17 changes: 17 additions & 0 deletions test/test_sai_fic_skill_table.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true

require "test/unit"
require "bcdice"
require "bcdice/dice_table/sai_fic_skill_table"

class TestSaiFicSkillTable < Test::Unit::TestCase
class DummySystem < BCDice::Base
table = BCDice::DiceTable::SaiFicSkillTable.new([])

register_prefix(table.prefixes)
end

def test_command_pattern
assert_equal(/^S?([+\-\dD(]+|\d+B\d+|C|choice|D66|(repeat|rep|x)\d+|\d+R\d+|\d+U\d+|BCDiceVersion|RTT[1-6]?|RCT)/i, DummySystem.command_pattern)
end
end

0 comments on commit 1eb03a9

Please sign in to comment.