diff --git a/lib/magic/cards/llanowar_visionary.rb b/lib/magic/cards/llanowar_visionary.rb new file mode 100644 index 0000000..6fd0f8c --- /dev/null +++ b/lib/magic/cards/llanowar_visionary.rb @@ -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 diff --git a/spec/cards/llanowar_visionary_spec.rb b/spec/cards/llanowar_visionary_spec.rb new file mode 100644 index 0000000..d10f729 --- /dev/null +++ b/spec/cards/llanowar_visionary_spec.rb @@ -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