summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2023-09-29 23:17:00 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2023-09-29 23:17:00 +0200
commitfe25d4bf82f4d0d3de0f8db44da93829eac6b44c (patch)
tree082b4a44b69ebc0ed67026e4511c594dbceca1f2 /spec
parentf8bbcdff828cf3cec7ae4529fbf8c7c8c7474da3 (diff)
downloadcolonial-twilight-fe25d4bf82f4d0d3de0f8db44da93829eac6b44c.zip
colonial-twilight-fe25d4bf82f4d0d3de0f8db44da93829eac6b44c.tar.gz
FLNRules : remove useless ()
Diffstat (limited to 'spec')
-rw-r--r--spec/fln_rules_spec.rb138
1 files changed, 71 insertions, 67 deletions
diff --git a/spec/fln_rules_spec.rb b/spec/fln_rules_spec.rb
index 486d3ec..a373082 100644
--- a/spec/fln_rules_spec.rb
+++ b/spec/fln_rules_spec.rb
@@ -9,103 +9,107 @@ end
describe ColonialTwilight::FLNRules do
rules = FLNRulesImpl.new
- describe 'Rally' do
- board = ColonialTwilight::Board.new
- # 25 sectors + 3 cities
- it 'collects spaces where operation can be conducted' do expect(rules.rally_spaces(board).size).to eq(28) end
+
+ before do
+ @board = ColonialTwilight::Board.new
end
describe 'Rally' do
- board = ColonialTwilight::Board.new
- board.load :short
- # 25 sectors + 2 countries
- it 'collects spaces where operation can be conducted' do expect(rules.rally_spaces(board).size).to eq(27) end
- end
+ it 'collects spaces where operation can be conducted' do
+ expect(rules.rally_spaces(@board).size).to eq(28)
+ end
- describe 'Agitate' do
- board = ColonialTwilight::Board.new
- it 'collects spaces where operation can be conducted' do expect(rules.agitate_spaces(board.spaces).size).to eq(0) end
+ it 'collects spaces where operation can be conducted' do
+ @board.load :short
+ # 25 sectors + 2 countries
+ expect(rules.rally_spaces(@board).size).to eq(27)
+ end
end
describe 'Agitate' do
- board = ColonialTwilight::Board.new
- board.load :short
- # 6 with bases + 1 in fln control
- it 'collects spaces where operation can be conducted' do expect(rules.agitate_spaces(board.spaces).size).to eq(5) end
- end
+ it 'collects spaces where operation can be conducted' do
+ expect(rules.agitate_spaces(@board.spaces).size).to eq(0)
+ end
- describe 'Attack' do
- board = ColonialTwilight::Board.new
- # 25 sectors + 3 cities
- it 'collects spaces where operation can be conducted' do expect(rules.attack_spaces(board).size).to eq(0) end
+ it 'collects spaces where operation can be conducted' do
+ @board.load :short
+ # 6 with bases + 1 in fln control
+ expect(rules.agitate_spaces(@board.spaces).size).to eq(5)
+ end
end
describe 'Attack' do
- board = ColonialTwilight::Board.new
- board.load :short
- # 25 sectors + 2 countries
- it 'collects spaces where operation can be conducted' do expect(rules.attack_spaces(board).size).to eq(7) end
- end
+ it 'collects spaces where operation can be conducted' do
+ # 25 sectors + 3 cities
+ expect(rules.attack_spaces(@board).size).to eq(0)
+ end
- describe 'Terror' do
- board = ColonialTwilight::Board.new
- it 'collects spaces where operation can be conducted' do expect(rules.terror_spaces(board).size).to eq(0) end
+ it 'collects spaces where operation can be conducted' do
+ @board.load :short
+ # 25 sectors + 2 countries
+ expect(rules.attack_spaces(@board).size).to eq(7)
+ end
end
describe 'Terror' do
- board = ColonialTwilight::Board.new
- board.load :short
- # 6 sectors
- it 'collects spaces where operation can be conducted' do expect(rules.terror_spaces(board).size).to eq(6) end
- end
+ it 'collects spaces where operation can be conducted' do
+ expect(rules.terror_spaces(@board).size).to eq(0)
+ end
- describe 'Extort' do
- board = ColonialTwilight::Board.new
- it 'collects spaces where operation can be conducted' do expect(rules.extort_spaces(board).size).to eq(0) end
+ it 'collects spaces where operation can be conducted' do
+ # 6 sectors
+ @board.load :short
+ expect(rules.terror_spaces(@board).size).to eq(6)
+ end
end
describe 'Extort' do
- board = ColonialTwilight::Board.new
- board.load :short
- # 2 sectors
- it 'collects spaces where operation can be conducted' do expect(rules.extort_spaces(board).size).to eq(2) end
- end
+ it 'collects spaces where operation can be conducted' do
+ expect(rules.extort_spaces(@board).size).to eq(0)
+ end
- describe 'Subvert' do
- board = ColonialTwilight::Board.new
- it 'collects spaces where operation can be conducted' do expect(rules.subvert_spaces(board).size).to eq(0) end
+ it 'collects spaces where operation can be conducted' do
+ @board.load :short
+ # 2 sectors
+ expect(rules.extort_spaces(@board).size).to eq(2)
+ end
end
describe 'Subvert' do
- board = ColonialTwilight::Board.new
- board.load :short
- # 4 sectors
- it 'collects spaces where operation can be conducted' do expect(rules.subvert_spaces(board).size).to eq(4) end
- end
+ it 'collects spaces where operation can be conducted' do
+ expect(rules.subvert_spaces(@board).size).to eq(0)
+ end
- describe 'Ambush' do
- board = ColonialTwilight::Board.new
- # 25 sectors + 3 cities
- it 'collects spaces where operation can be conducted' do expect(rules.ambush_spaces(board).size).to eq(0) end
+ it 'collects spaces where operation can be conducted' do
+ @board.load :short
+ # 4 sectors
+ expect(rules.subvert_spaces(@board).size).to eq(4)
+ end
end
describe 'Ambush' do
- board = ColonialTwilight::Board.new
- board.load :short
- # 25 sectors + 2 countries
- it 'collects spaces where operation can be conducted' do expect(rules.ambush_spaces(board).size).to eq(7) end
- end
+ it 'collects spaces where operation can be conducted' do
+ # 25 sectors + 3 cities
+ expect(rules.ambush_spaces(@board).size).to eq(0)
+ end
- describe 'OAS' do
- board = ColonialTwilight::Board.new
- # 14 sectors + 3 cities
- it 'collects spaces where operation can be conducted' do expect(rules.oas_spaces(board).size).to eq(17) end
+ it 'collects spaces where operation can be conducted' do
+ @board.load :short
+ # 25 sectors + 2 countries
+ expect(rules.ambush_spaces(@board).size).to eq(7)
+ end
end
describe 'OAS' do
- board = ColonialTwilight::Board.new
- board.load :short
- # 11 sectors + 3 countries
- it 'collects spaces where operation can be conducted' do expect(rules.oas_spaces(board).size).to eq(14) end
+ it 'collects spaces where operation can be conducted' do
+ # 14 sectors + 3 cities
+ expect(rules.oas_spaces(@board).size).to eq(17)
+ end
+
+ it 'collects spaces where operation can be conducted' do
+ @board.load :short
+ # 11 sectors + 3 countries
+ expect(rules.oas_spaces(@board).size).to eq(14)
+ end
end
end