summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2023-11-19 12:14:21 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2023-11-19 12:14:21 +0100
commit6829aa96f06ee2fc3eb20cb124611827928d16a3 (patch)
tree951ff5209f0aa8fa920347adbd24c41e3858c28e /spec
parentf3779466615840bbe5a77d5ff18cf9c3b70b8658 (diff)
downloadcolonial-twilight-6829aa96f06ee2fc3eb20cb124611827928d16a3.zip
colonial-twilight-6829aa96f06ee2fc3eb20cb124611827928d16a3.tar.gz
Spaces/Forces : add #activate(num) && specs
Diffstat (limited to 'spec')
-rw-r--r--spec/forces_spec.rb8
-rw-r--r--spec/spaces_spec.rb6
2 files changed, 14 insertions, 0 deletions
diff --git a/spec/forces_spec.rb b/spec/forces_spec.rb
index ce6316f..110139e 100644
--- a/spec/forces_spec.rb
+++ b/spec/forces_spec.rb
@@ -132,6 +132,14 @@ describe ColonialTwilight::Forces do
expect { @f.add :wrong, 1 }.to raise_error(Exception)
end
+ it 'activate raise' do
+ expect { @f.activate(7) }.to raise_error(Exception)
+ end
+
+ it 'activate' do
+ expect(@f.activate(6)).to eq 13
+ end
+
it 'data' do
d = @f.data
@data.keys do |k, v|
diff --git a/spec/spaces_spec.rb b/spec/spaces_spec.rb
index e1d75ca..0e05707 100644
--- a/spec/spaces_spec.rb
+++ b/spec/spaces_spec.rb
@@ -136,6 +136,12 @@ describe ColonialTwilight::Sector do
expect(@s.resettled?).to be true
expect(@s.pop).to eq 0
end
+
+ it 'activate' do
+ @s.add :fln_active, 1
+ @s.add :fln_underground, 2
+ expect(@s.activate(2)).to eq 3
+ end
end
describe ColonialTwilight::City do