Sha256: df0e11e5e89e156a9536a681756e2382835f0f6b106618d1cc32f6aaef1faa41

Contents?: true

Size: 822 Bytes

Versions: 4

Compression:

Stored size: 822 Bytes

Contents

# Based on turnip/examples

step "there is a monster" do
  @monster = 1
end

step "there is a strong monster" do
  @monster = 2
end

step "I attack it" do
  @attack ||= 1 # no weapon
  @monster -= @attack
end

step "it should die" do
  expect(@monster).to be <= 0
end

step "Fanfare" do
end

step "I equip a weapon" do
  @attack = 2
end

step "there are monsters:" do |monsters|
  @monsters = monsters.map { |row| row[0] }
end

step "I escape" do
  @escape_result = (@monsters.count <= 2)
end

step "I was able to escape" do
  expect(@escape_result).to be_true
end

step "I could not escape" do
  expect(@escape_result).to be_false
end

step "the monster sings the following song" do |song|
  @song = song
end

step "the song should have :count lines" do |count|
  @song.to_s.split("\n").length.should eq(count.to_i)
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
turnip_formatter-0.0.4 spec/examples/steps/steps.rb
turnip_formatter-0.0.3 spec/examples/steps/steps.rb
turnip_formatter-0.0.2 spec/examples/steps/steps.rb
turnip_formatter-0.0.1 spec/examples/steps/steps.rb