Sha256: eb30f06282c2031fbfbae32bc204b20b1a769455016b7cc3497d0553a814d700

Contents?: true

Size: 472 Bytes

Versions: 35

Compression:

Stored size: 472 Bytes

Contents

module KnightSteps
  attr_accessor :knight

  class Knight
    def initialize
      @hp = 20
    end

    def alive?
      @hp > 0
    end

    def attacked_for(amount)
      @hp -= amount
    end
  end

  step "there is a knight" do
    self.knight = Knight.new
  end

  step "the knight is alive" do
    knight.should be_alive
  end

  step "the knight is dead" do
    knight.should_not be_alive
  end
end

RSpec.configure { |c| c.include KnightSteps, :knight => true }

Version data entries

35 entries across 35 versions & 2 rubygems

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