diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2023-10-23 13:37:35 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2023-10-23 13:37:35 +0200 |
commit | 6822431aa1d93a11a8ab266284783814747721f3 (patch) | |
tree | 354dc2fec21577b8c8443eb045f3c7a3ed3c3331 /spec/fln_rules_spec.rb | |
parent | 52e7a831cbff3ac1b9940e7f8a207db95f67d564 (diff) | |
download | colonial-twilight-6822431aa1d93a11a8ab266284783814747721f3.zip colonial-twilight-6822431aa1d93a11a8ab266284783814747721f3.tar.gz |
FLNRules : improve specs
Diffstat (limited to 'spec/fln_rules_spec.rb')
-rw-r--r-- | spec/fln_rules_spec.rb | 28 |
1 files 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 |