Sha256: 4191b9ebc45bcf8d555cf9f412877e29c809b8a6487d9393b67cb559eb5770e1

Contents?: true

Size: 683 Bytes

Versions: 35

Compression:

Stored size: 683 Bytes

Contents

require_relative "knight_steps"

module DragonSteps
  include KnightSteps

  attr_accessor :dragon

  def dragon_attack
    dragon * 10
  end

  step "there is a dragon" do
    self.dragon = 1
  end

  step "the dragon attacks the knight" do
    knight.attacked_for(dragon_attack)
  end
end

module RedDragonSteps
  include DragonSteps

  attr_accessor :red_dragon

  def dragon_attack
    attack = super
    if red_dragon
      attack + 15
    else
      attack
    end
  end

  step "the dragon breathes fire" do
    self.red_dragon = 1
  end
end

RSpec.configure { |c| c.include DragonSteps, :dragon => true }
RSpec.configure { |c| c.include RedDragonSteps, :red_dragon => true }

Version data entries

35 entries across 35 versions & 2 rubygems

Version Path
turnip-4.4.1 examples/steps/dragon_steps.rb
turnip-4.4.0 examples/steps/dragon_steps.rb
turnip-4.3.0 examples/steps/dragon_steps.rb
turnip-4.2.0 examples/steps/dragon_steps.rb
turnip-4.1.0 examples/steps/dragon_steps.rb
allure_turnip-0.4.0 spec/steps/dragon_steps.rb
allure_turnip-0.3.1 spec/steps/dragon_steps.rb
turnip-4.0.1 examples/steps/dragon_steps.rb
allure_turnip-0.3.0 spec/steps/dragon_steps.rb
turnip-4.0.0 examples/steps/dragon_steps.rb
allure_turnip-0.2.1 spec/steps/dragon_steps.rb
allure_turnip-0.2.0 spec/steps/dragon_steps.rb
allure_turnip-0.1.1 spec/steps/dragon_steps.rb
allure_turnip-0.1.0 spec/steps/dragon_steps.rb
turnip-3.1.0 examples/steps/dragon_steps.rb
turnip-3.0.0 examples/steps/dragon_steps.rb
turnip-3.0.0.pre.beta.5 examples/steps/dragon_steps.rb
turnip-3.0.0.pre.beta.4 examples/steps/dragon_steps.rb
turnip-3.0.0.pre.beta.3 examples/steps/dragon_steps.rb
turnip-3.0.0.pre.beta.2 examples/steps/dragon_steps.rb