-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #259
- Loading branch information
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module Magic | ||
module Cards | ||
RadiantFountain = Card("Radiant Fountain") do | ||
type "Land" | ||
|
||
enters_the_battlefield do | ||
permanent.controller.gain_life(2) | ||
end | ||
end | ||
|
||
class RadiantFountain < Card | ||
def enters_tapped? | ||
false | ||
end | ||
|
||
class ManaAbility < Magic::TapManaAbility | ||
choices :colorless | ||
end | ||
|
||
def activated_abilities = [ManaAbility] | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
require 'spec_helper' | ||
|
||
RSpec.describe Magic::Cards::RadiantFountain do | ||
include_context "two player game" | ||
|
||
let(:card) { Card("Radiant Fountain") } | ||
|
||
let!(:permanent) do | ||
p1.play_land(land: card) | ||
p1.permanents.by_name("Radiant Fountain").first | ||
end | ||
|
||
it "enters the battlefield untapped" do | ||
game.stack.resolve! | ||
expect(permanent).not_to be_tapped | ||
end | ||
|
||
it "has the controller gain life" do | ||
expect(p1.life).to eq(22) | ||
end | ||
|
||
it "taps for colorless" do | ||
p1.activate_mana_ability(ability: permanent.activated_abilities.first) do | ||
_1.choose(:colorless) | ||
end | ||
|
||
expect(p1.mana_pool[:colorless]).to eq(1) | ||
end | ||
|
||
it "cannot tap for another color" do | ||
expect { | ||
p1.activate_mana_ability(ability: permanent.activated_abilities.first) do | ||
_1.choose(:blue) | ||
end | ||
}.to raise_error("Invalid choice made for mana ability:") | ||
end | ||
end |