class Cucumber::Core::Ast::DocString
Note how the indentation from the source is stripped away.
example above, that would return: "I like\nCucumber sandwich"
The StepDefinition can then access the String via the #to_s method. In the
which is yielded to the StepDefinition block as the last argument.
The text between the pair of """
is stored inside a DocString,
“”“
Cucumber sandwich
I like
”“”
Given the message
Represents an inline argument in a step. Example:
def ==(other)
def ==(other) if other.respond_to?(:content_type) return false unless content_type == other.content_type end if other.respond_to?(:to_str) return content == other.to_str end raise ArgumentError, "Can't compare a #{self.class.name} with a #{other.class.name}" end
def description_for_visitors
def description_for_visitors :doc_string end
def encoding
def encoding @content.encoding end
def gsub(*args)
def gsub(*args) @content.gsub(*args) end
def initialize(string, content_type, location)
def initialize(string, content_type, location) @content = string @content_type = content_type @location = location end
def map
def map raise ArgumentError, "No block given" unless block_given? new_content = yield content self.class.new(new_content, content_type, location) end
def to_s
def to_s to_str end
def to_step_definition_arg
def to_step_definition_arg self end
def to_str
def to_str @content end