From 6822431aa1d93a11a8ab266284783814747721f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 23 Oct 2023 13:37:35 +0200 Subject: FLNRules : improve specs --- spec/fln_rules_spec.rb | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/spec/fln_rules_spec.rb b/spec/fln_rules_spec.rb index 9a8c39c..fe8e301 100644 --- a/spec/fln_rules_spec.rb +++ b/spec/fln_rules_spec.rb @@ -25,17 +25,31 @@ describe ColonialTwilight::FLNRules do expect(rules.rally_spaces(@board).size).to eq(27) end + it 'may_rally_in? not in city at support' do + a = ColonialTwilight::City.new('a', 'w', 0, 0) + a.shift :support + expect(rules.may_rally_in?(a)).to be false + end + + it 'may_rally_in? not in not independent country' do + a = ColonialTwilight::Country.new('country') + expect(rules.may_rally_in?(a)).to be false + end + + it 'may_rally_in?' do + a = ColonialTwilight::Sector.new('a', 'w', 0, 0) + expect(rules.may_rally_in?(a)).to be true + end + it 'may place 1 FLN cube' do - @board.load :short - space = @board.by_name('Mostaganem') - expect(rules.max_placable_guerrillas(space)).to eq(1) + a = ColonialTwilight::Sector.new('a', 'w', 0, 0) + expect(rules.max_placable_guerrillas(a)).to eq(1) end it 'may place 2 FLN cube' do - @board.load :short - space = @board.by_name('Orleansville') - space.add :fln_base - expect(rules.max_placable_guerrillas(space)).to eq(4) + a = ColonialTwilight::Sector.new('a', 'w', 0, 2) + a.add :fln_base + expect(rules.max_placable_guerrillas(a)).to eq(3) end end -- cgit v1.1-2-g2b99