diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2023-09-21 09:22:07 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2023-09-21 09:22:07 +0200 |
commit | ca128a74ae0f238b9ba81df68ed26e3b9a223e1e (patch) | |
tree | e5985c9eda5527a394e70f344a881f2920b47144 /spec/cards_spec.rb | |
parent | 6da1db151f295b910cc7244ba0211b438a914514 (diff) | |
download | colonial-twilight-ca128a74ae0f238b9ba81df68ed26e3b9a223e1e.zip colonial-twilight-ca128a74ae0f238b9ba81df68ed26e3b9a223e1e.tar.gz |
Cards : set attributes with specs
Diffstat (limited to 'spec/cards_spec.rb')
-rw-r--r-- | spec/cards_spec.rb | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/spec/cards_spec.rb b/spec/cards_spec.rb new file mode 100644 index 0000000..12ffb24 --- /dev/null +++ b/spec/cards_spec.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +require './lib/colonial_twilight/deck' + +describe ColonialTwilight::Card do + describe 'Propaganda' do + deck = ColonialTwilight::Deck.new + s = [67, 68, 69, 70, 71] + 1.upto(71) do |n| + it "is flags right #{n}" do expect(deck.pull(n).propaganda?).to be s.include?(n) end + end + end + + describe 'Single or Dual' do + deck = ColonialTwilight::Deck.new + s = [4, 9, 14, 18, 20, 25, 28, 30, 52, 54, 56, 57, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71] + 1.upto(71) do |n| + it "is flags right #{n}" do expect(deck.pull(n).single?).to be s.include?(n) end + end + end + + describe 'FLN capability' do + deck = ColonialTwilight::Deck.new + s = [17, 27, 32, 33] + 1.upto(71) do |n| + it "is flags right #{n}" do expect(deck.pull(n).fln_capability?).to be s.include?(n) end + end + end + + describe 'GOV capability' do + deck = ColonialTwilight::Deck.new + s = [13, 35] + 1.upto(71) do |n| + it "is flags right #{n}" do expect(deck.pull(n).gov_capability?).to be s.include?(n) end + end + end + + describe 'DUAL capability' do + deck = ColonialTwilight::Deck.new + s = [18] + 1.upto(71) do |n| + it "is flags right #{n}" do expect(deck.pull(n).dual_capability?).to be s.include?(n) end + end + end + + describe 'FLN momentum' do + deck = ColonialTwilight::Deck.new + s = [2, 8, 10, 29, 40, 45] + 1.upto(71) do |n| + it "is flags right #{n}" do expect(deck.pull(n).fln_momentum?).to be s.include?(n) end + end + end + + describe 'GOV momentum' do + deck = ColonialTwilight::Deck.new + s = [5, 11, 12, 31, 44, 45, 46, 53] + 1.upto(71) do |n| + it "is flags right #{n}" do expect(deck.pull(n).gov_momentum?).to be s.include?(n) end + end + end + + describe 'DUAL momentum' do + deck = ColonialTwilight::Deck.new + s = [56, 57] + 1.upto(71) do |n| + it "is flags right #{n}" do expect(deck.pull(n).dual_momentum?).to be s.include?(n) end + end + end +end |