Module: Cucumber::Salad::DSL

Defined in:
lib/cucumber/salad/dsl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#widget_lookup_scopeObject



25
26
27
# File 'lib/cucumber/salad/dsl.rb', line 25

def widget_lookup_scope
  @widget_lookup_scope ||= default_widget_lookup_scope
end

Instance Method Details

#documentWidgets::Document

Returns the current document with the class of the current object set as the widget lookup scope.

Returns:

  • (Widgets::Document)

    the current document with the class of the current object set as the widget lookup scope.



8
9
10
# File 'lib/cucumber/salad/dsl.rb', line 8

def document
  Widgets::Document.new(widget_lookup_scope: widget_lookup_scope)
end

#has_widget?(name) ⇒ Boolean

Returns Whether one or more widgets exist in the current document.

Returns:

  • (Boolean)

    Whether one or more widgets exist in the current document.



14
15
16
# File 'lib/cucumber/salad/dsl.rb', line 14

def has_widget?(name)
  document.has_widget?(name)
end

#widget(name, options = {}) ⇒ Object

Returns a widget instance for the given name.

Parameters:

  • name (String, Symbol)


21
22
23
# File 'lib/cucumber/salad/dsl.rb', line 21

def widget(name, options = {})
  document.widget(name, options)
end