Skip to content

Commit 3cbbb1a

Browse files
committed
WIP: Fixing failing specs
1 parent d9f48c7 commit 3cbbb1a

13 files changed

+59
-11
lines changed

lib/magic/abilities/static/power_and_toughness_modification.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ def toughness_modification
3030
end
3131

3232
def applies_to?(permanent)
33-
binding.pry if $RYAN
3433
applicable_targets.include?(permanent)
3534
end
3635
end

spec/cards/annex_sentry_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
let(:wood_elves) { ResolvePermanent("Wood Elves", owner: p2) }
99
let(:loxodon_wayfarer) { ResolvePermanent("Loxodon Wayfarer", owner: p2) }
1010

11+
before do
12+
p1.hand.add(annex_sentry)
13+
end
14+
1115
it "has toxic 1" do
1216
expect(annex_sentry).to have_keyword(Magic::Cards::Keywords::Toxic)
1317
end

spec/cards/annul_spec.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@
3030
end
3131

3232
it "cannot target a thing that is not an artifact or enchantment" do
33+
wood_elves = Card("Wood Elves", owner: p2)
34+
p2.hand.add(wood_elves)
35+
3336
p2.add_mana(green: 3)
34-
wood_elves_cast = p2.cast(card: Card("Wood Elves")) do
37+
wood_elves_cast = p2.cast(card: wood_elves) do
3538
_1.pay_mana(generic: { green: 2 }, green: 1)
3639
end
3740

spec/cards/arasta_of_the_endless_web_spec.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77

88
context "whenever an opponent casts an instant or sorcery spell..." do
99
it "does not trigger when p1 casts" do
10+
lightning_bolt = Card("Lightning Bolt", owner: p1)
11+
p1.hand.add(lightning_bolt)
1012
p1.add_mana(red: 1)
11-
p1.cast(card: Card("Lightning Bolt")) do
13+
p1.cast(card: lightning_bolt) do
1214
_1.pay_mana(red: 1)
1315
_1.targeting(p2)
1416
end
@@ -19,8 +21,10 @@
1921
end
2022

2123
it "triggers when p2 casts" do
24+
lightning_bolt = Card("Lightning Bolt", owner: p2)
25+
p2.hand.add(lightning_bolt)
2226
p2.add_mana(red: 1)
23-
p2.cast(card: Card("Lightning Bolt")) do
27+
p2.cast(card: lightning_bolt) do
2428
_1.pay_mana(red: 1)
2529
_1.targeting(p1)
2630
end
@@ -37,8 +41,10 @@
3741
end
3842

3943
it "does not trigger when p2 casts wood elves" do
44+
wood_elves = Card("Wood Elves", owner: p2)
45+
p2.hand.add(wood_elves)
4046
p2.add_mana(green: 3)
41-
p2.cast(card: Card("Wood Elves")) do
47+
p2.cast(card: wood_elves) do
4248
_1.pay_mana(green: 1, generic: { green: 2 })
4349
end
4450

spec/cards/archon_of_suns_grace_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@
3838
end
3939

4040
it "... under your control, create a pegasus" do
41+
nine_lives = Card("Nine Lives", owner: p1)
42+
p1.hand.add(nine_lives)
4143
p1.add_mana(white: 3)
42-
p1.cast(card: Card("Nine Lives")) do
44+
p1.cast(card: nine_lives) do
4345
_1.pay_mana(generic: { white: 1 }, white: 2)
4446
end
4547

spec/cards/battle_for_bretagard_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55

66
let(:card) { Card("Battle For Bretagard") }
77

8+
before do
9+
p1.hand.add(card)
10+
end
11+
812
it "gets a counter + creates a human warrior when it is cast" do
913
p1.add_mana(white: 1, green: 2)
1014

spec/cards/bog_badger_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
let!(:loxodon_wayfarer) { ResolvePermanent("Loxodon Wayfarer", owner: p1) }
88
let!(:wood_elves) { ResolvePermanent("Wood Elves", owner: p2) }
99

10+
before do
11+
p1.hand.add(subject)
12+
end
13+
1014
context "resolution" do
1115
it "kicker cost paid" do
1216
p1.add_mana(green: 3, black: 1)

spec/cards/bombard_spec.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,17 @@
88

99
let(:bombard) { Card("Bombard") }
1010

11+
before do
12+
p1.hand.add(bombard)
13+
end
14+
1115
it "destroys the wood elves" do
1216
p1.add_mana(red: 3)
1317
action = cast_action(player: p1, card: bombard)
14-
action.pay_mana(generic: { red: 2 }, red: 1)
1518
expect(action.target_choices).to include(wood_elves)
1619
expect(action.target_choices).to include(alpine_watchdog)
1720
action.targeting(wood_elves)
21+
action.auto_pay_mana
1822
game.take_action(action)
1923
game.stack.resolve!
2024
expect(wood_elves.damage).to eq(4)

spec/cards/burn_bright_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55

66
let!(:burn_bright) { Card("Burn Bright") }
77

8+
before do
9+
p1.hand.add(burn_bright)
10+
end
11+
812
context "with 2 creature in play" do
913

1014
let!(:blood_glutton) { ResolvePermanent("Blood Glutton", owner: p1) }

spec/cards/capture_sphere_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55

66
subject { Card("Capture Sphere") }
77

8+
before do
9+
p1.hand.add(subject)
10+
end
11+
812
context "resolution" do
913
let!(:wood_elves) { ResolvePermanent("Wood Elves", owner: p2) }
1014

0 commit comments

Comments
 (0)