Module: WatirSplash::SpecHelper

Included in:
Page::Base
Defined in:
lib/watirsplash/spec_helper.rb

Overview

main helper module

these methods can be used in specs directly

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object

:nodoc:



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/watirsplash/spec_helper.rb', line 7

def method_missing name, *args #:nodoc:

  if WatirSplash::Browser.current.respond_to?(name)
    SpecHelper.module_eval %Q[
      def #{name}(*args)
        WatirSplash::Browser.current.send(:#{name}, *args) {yield}
      end
    ]
    self.send(name, *args) {yield}
  else
    super
  end
end

Instance Method Details

#p(*args) ⇒ Object

make sure that using method ‘p’ will be invoked on browser and not Kernel use Kernel.p if you need to dump some variable



23
24
25
# File 'lib/watirsplash/spec_helper.rb', line 23

def p *args #:nodoc:

  WatirSplash::Browser.current.p *args
end