Sha256: 5c88c0cdb19d8d4d049bfc0c45a9eb0f1a7ad28284591f54ce00dce82433e78e

Contents?: true

Size: 1.38 KB

Versions: 1

Compression:

Stored size: 1.38 KB

Contents

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

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

step "I attack it" do
  @monster -= 1
end

step "it should die" do
  @monster.should eq(0)
end

step "this is ambiguous" do
end

step "this is ambiguous" do
end

step "there is a monster called :name" do |name|
  @monster_name = name
end

step 'it should be called "John Smith"' do
  @monster_name.should == "John Smith"
end

step 'it should be called "John"' do
  @monster_name.should == "John"
end

step "there is a monster with :count hitpoints" do |count|
  @monster = count
end

step "I attack the monster and do :count points damage" do |count|
  @monster -= count
end

step "the monster should be alive" do
  @monster.should > 0
end

step "the monster should be dead" do
  @monster.should <= 0
end

step "there are the following monsters:" do |table|
  @monsters = {}
  table.hashes.each do |hash|
    @monsters[hash['Name']] = hash['Hitpoints'].to_i
  end
end

step ":name should have :count hitpoints" do |name, count|
  @monsters[name].should eq(count.to_i)
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)
end

placeholder :count do
  match /\d+/ do |count|
    count.to_i
  end
end

placeholder :color do
  match /blue|green|red/ do |color|
    color.to_sym
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
turnip-0.3.0 examples/steps.rb