diff options
Diffstat (limited to 'spec/fln_bot_rules_spec.rb')
-rw-r--r-- | spec/fln_bot_rules_spec.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/spec/fln_bot_rules_spec.rb b/spec/fln_bot_rules_spec.rb index 1881f39..c21d339 100644 --- a/spec/fln_bot_rules_spec.rb +++ b/spec/fln_bot_rules_spec.rb @@ -6,10 +6,10 @@ require './spec/mock_board' class FLNRulesImpl include ColonialTwilight::FLNBotRules attr_reader :board - attr_writer :limited_op_only, :first_eligible, :will_be_next_first_eligible + attr_writer :debug, :limited_op_only, :first_eligible, :will_be_next_first_eligible def initialize - @debug = 666 + @debug = 0 @board = Board.new @limited_op_only = true @first_eligible = true @@ -44,6 +44,18 @@ describe ColonialTwilight::FLNBotRules do @board = @rules.board end + describe 'Debug' do + it 'level 1' do + @rules.debug = 1 + expect { @rules.dbg('msg', true) }.to output(" msg : YES\n").to_stdout + end + + it 'level 2' do + @rules.debug = 2 + expect { @rules.dbg('msg', false) }.to output(" msg : NO\n").to_stdout + end + end + describe 'Pass' do it 'pass? no resources' do expect(@rules.pass?).to be true |