class Cucumber::Core::Test::Step

Attributes

id[R]
location[R]
multiline_arg[R]
text[R]

Public Class Methods

new(id, text, location, multiline_arg = Test::EmptyMultilineArgument.new, action = Test::UndefinedAction.new(location)) click to toggle source
# File lib/cucumber/core/test/step.rb, line 13
def initialize(id, text, location, multiline_arg = Test::EmptyMultilineArgument.new, action = Test::UndefinedAction.new(location))
  raise ArgumentError if text.nil? || text.empty?
  @id = id
  @text = text
  @location = location
  @multiline_arg = multiline_arg
  @action = action
end

Public Instance Methods

action_location() click to toggle source
# File lib/cucumber/core/test/step.rb, line 50
def action_location
  @action.location
end
backtrace_line() click to toggle source
# File lib/cucumber/core/test/step.rb, line 42
def backtrace_line
  "#{location}:in `#{text}'"
end
describe_to(visitor, *args) click to toggle source
# File lib/cucumber/core/test/step.rb, line 22
def describe_to(visitor, *args)
  visitor.test_step(self, *args)
end
execute(*args) click to toggle source
# File lib/cucumber/core/test/step.rb, line 34
def execute(*args)
  @action.execute(*args)
end
hook?() click to toggle source
# File lib/cucumber/core/test/step.rb, line 26
def hook?
  false
end
inspect() click to toggle source
# File lib/cucumber/core/test/step.rb, line 58
def inspect
  "#<#{self.class}: #{location}>"
end
matching_locations() click to toggle source
# File lib/cucumber/core/test/step.rb, line 54
def matching_locations
  [location.merge(multiline_arg)]
end
skip(*args) click to toggle source
# File lib/cucumber/core/test/step.rb, line 30
def skip(*args)
  @action.skip(*args)
end
to_s() click to toggle source
# File lib/cucumber/core/test/step.rb, line 46
def to_s
  text
end
with_action(action_location = nil, &block) click to toggle source
# File lib/cucumber/core/test/step.rb, line 38
def with_action(action_location = nil, &block)
  self.class.new(id, text, location, multiline_arg, Test::Action.new(action_location, &block))
end