Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions lib/magic/cards/llanowar_visionary.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module Magic
module Cards
LlanowarVisionary = Creature("Llanowar Visionary") do
cost generic: 1, green: 1
creature_type "Elf Druid"
power 2
toughness 2

enters_the_battlefield do
actor.trigger_effect(:draw_cards)
end
end

class LlanowarVisionary < Creature
class ManaAbility < Magic::TapManaAbility
choices :green
end

def activated_abilities = [ManaAbility]
end
end
end
36 changes: 36 additions & 0 deletions spec/cards/llanowar_visionary_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Magic::Cards::LlanowarVisionary do
include_context "two player game"

let(:forest) { Card("Forest") }

before do
p1.library.add(forest)
end

subject { ResolvePermanent("Llanowar Visionary", owner: p1) }

context "ETB effect" do
it "controller draws a card" do
expect(p1).to receive(:draw!)
subject
end
end

context "stats" do
it "is a 2/2" do
expect(subject.power).to eq(2)
expect(subject.toughness).to eq(2)
end
end

context "mana ability" do
it "taps for one green mana" do
p1.activate_ability(ability: subject.activated_abilities.first)
expect(p1.mana_pool[:green]).to eq(1)
end
end
end
Loading