diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/fln_bot_rules_spec.rb | 10 | ||||
-rw-r--r-- | spec/mock_board.rb | 4 |
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 |