class Cucumber::Core::Test::DocString
Represents an inline argument in a step. Example:
Given the message """ I like Cucumber sandwich """
The text between the pair of """
is stored
inside a DocString, which is yielded to the
StepDefinition block as the last argument.
The StepDefinition can then access the String via the to_s method. In the
example above, that would return: "I like\nCucumber
sandwich"
Note how the indentation from the source is stripped away.
Attributes
content[R]
content_type[R]
Public Class Methods
new(content, content_type)
click to toggle source
Calls superclass method
# File lib/cucumber/core/test/doc_string.rb, line 24 def initialize(content, content_type) @content = content @content_type = content_type super @content end
Public Instance Methods
==(other)
click to toggle source
# File lib/cucumber/core/test/doc_string.rb, line 52 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 false end
data_table?()
click to toggle source
# File lib/cucumber/core/test/doc_string.rb, line 34 def data_table? false end
describe_to(visitor, *args)
click to toggle source
# File lib/cucumber/core/test/doc_string.rb, line 30 def describe_to(visitor, *args) visitor.doc_string(self, *args) end
doc_string?()
click to toggle source
# File lib/cucumber/core/test/doc_string.rb, line 38 def doc_string? true end
inspect()
click to toggle source
# File lib/cucumber/core/test/doc_string.rb, line 62 def inspect [ %{#<#{self.class}}, %{ """#{content_type}}, %{ #{@content}}, %{ """>} ].join("\n") end
map() { |content| ... }
click to toggle source
# File lib/cucumber/core/test/doc_string.rb, line 42 def map raise ArgumentError, "No block given" unless block_given? new_content = yield content self.class.new(new_content, content_type) end
to_step_definition_arg()
click to toggle source
# File lib/cucumber/core/test/doc_string.rb, line 48 def to_step_definition_arg self end