summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2023-10-24 09:32:52 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2023-10-24 09:32:52 +0200
commit4a3f2e4adce52e7a3495f0a825fe2f502e052006 (patch)
tree466b94034eb6d84dd76c7eaea2178570ebf746fd /spec
parentab2b97fc77b8b52c8b9a402b59dbf4454516b64f (diff)
downloadcolonial-twilight-4a3f2e4adce52e7a3495f0a825fe2f502e052006.zip
colonial-twilight-4a3f2e4adce52e7a3495f0a825fe2f502e052006.tar.gz
FLNBotRules : add #available_fln_bases, comment, fix Mock#terror
Diffstat (limited to 'spec')
-rw-r--r--spec/fln_bot_rules_spec.rb10
-rw-r--r--spec/mock_board.rb4
2 files changed, 12 insertions, 2 deletions
diff --git a/spec/fln_bot_rules_spec.rb b/spec/fln_bot_rules_spec.rb
index 547e2ea..a841b67 100644
--- a/spec/fln_bot_rules_spec.rb
+++ b/spec/fln_bot_rules_spec.rb
@@ -367,6 +367,16 @@ describe ColonialTwilight::FLNBotRules do
end
describe '8.1.2 Procedure Guidelines' do
+ it 'available_fln_bases?' do
+ @board.available_fln_bases = 0
+ expect(@rules.available_fln_bases?).to be false
+ end
+
+ it 'available_fln_bases?' do
+ @board.available_fln_bases = 1
+ expect(@rules.available_fln_bases?).to be true
+ end
+
it 'may_add_base_in?' do
a = Sector.new({ fln_active: 3 })
expect(@rules.may_add_base_in?(a)).to be true
diff --git a/spec/mock_board.rb b/spec/mock_board.rb
index 18dad5b..e75ba73 100644
--- a/spec/mock_board.rb
+++ b/spec/mock_board.rb
@@ -4,7 +4,7 @@ class Sector
attr_reader :name
attr_writer :data
- def initialize(data = { name: 'sector', pop: 0, fln_bases: 0, fln_active: 0, fln_underground: 0, gov_cubes: 0, independent: true, support: false, terror: false })
+ def initialize(data = { name: 'sector', pop: 0, fln_bases: 0, fln_active: 0, fln_underground: 0, gov_cubes: 0, independent: true, support: false, terror: 0 })
@name = data[:name] || 'sector'
@data = data
end
@@ -33,7 +33,7 @@ class Sector
@data[:support]
end
- def terror?
+ def terror
@data[:terror]
end