Sha256: 5df1914d11694381e90a621e1d529443efce33a71ca63a4ec130f2d6553c19d0

Contents?: true

Size: 712 Bytes

Versions: 16

Compression:

Stored size: 712 Bytes

Contents

module WatirSplash
  # main helper module
  #
  # these methods can be used in specs directly
  module SpecHelper

    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

    # make sure that using method 'p' will be invoked on browser
    # and not Kernel
    # use Kernel.p if you need to dump some variable 
    def p *args #:nodoc:
      WatirSplash::Browser.current.p *args
    end

  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
watirsplash-2.4.4 lib/watirsplash/spec_helper.rb
watirsplash-2.4.3 lib/watirsplash/spec_helper.rb
watirsplash-2.4.2 lib/watirsplash/spec_helper.rb
watirsplash-2.4.1 lib/watirsplash/spec_helper.rb
watirsplash-2.4.0 lib/watirsplash/spec_helper.rb
watirsplash-2.3.2 lib/watirsplash/spec_helper.rb
watirsplash-2.3.1 lib/watirsplash/spec_helper.rb
watirsplash-2.3.0 lib/watirsplash/spec_helper.rb
watirsplash-2.2.0 lib/watirsplash/spec_helper.rb
watirsplash-2.1.1 lib/watirsplash/spec_helper.rb
watirsplash-2.1.0 lib/watirsplash/spec_helper.rb
watirsplash-2.0.1.rc5 lib/watirsplash/spec_helper.rb
watirsplash-2.0.1.rc4 lib/watirsplash/spec_helper.rb
watirsplash-2.0.1.rc3 lib/watirsplash/spec_helper.rb
watirsplash-2.0.1.rc1 lib/watirsplash/spec_helper.rb
watirsplash-2.0.0 lib/watirsplash/spec_helper.rb