Module: Simulacrum::Methods

Defined in:
lib/simulacrum/methods.rb

Overview

Rspec utility methods for defining components, browser environments and

Instance Method Summary collapse

Instance Method Details

#component(name) {|options| ... } ⇒ Object

Yields:

  • (options)


8
9
10
11
12
13
14
15
16
17
# File 'lib/simulacrum/methods.rb', line 8

def component(name, &block)
  options = OpenStruct.new
  yield options
  component = Simulacrum::Component.new(name, options)
  Simulacrum.components[name] = component

  subject do
    component
  end
end

#configure_browser(name) {|options| ... } ⇒ Object

Yields:

  • (options)


19
20
21
22
23
# File 'lib/simulacrum/methods.rb', line 19

def configure_browser(name, &block)
  options = OpenStruct.new
  yield options
  @browser = Simulacrum::Browser.new(name, options)
end