Sha256: 352a1d998132b584060db33227644f7a9905b4231cde79c97558158227439769

Contents?: true

Size: 899 Bytes

Versions: 6

Compression:

Stored size: 899 Bytes

Contents

# encoding: utf-8
$LOAD_PATH.unshift File.dirname(__FILE__)
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'rspec'

require 'guards'
require 'server'

require 'operawatir/helper'

OperaWatir.api = 2

RSpec.configure do |config|
  config.mock_with :rr
end

module WatirSpec
  extend self

  attr_accessor :args, :guarded

  def host
    "http://#{Server.bind}:#{Server.port}"
  end
  alias_method :files, :host

  def guards
    @guards ||= []
  end

  def guarded?
    !!@guarded
  end

  module Helpers
    def browser
      OperaWatir::Helper.browser
    end

    def window
      browser.active_window
    end

    def fixture(*paths)
      [WatirSpec.host, *paths].join('/')
    end
  end

end

include WatirSpec::Guard::Helpers

RSpec.configure do |config|
  config.include WatirSpec::Helpers

  config.before(:suite) do
    Thread.new { WatirSpec::Server.run! }
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
operawatir-0.6.pre1-jruby spec/operawatir/watirspec_helper.rb
operawatir-0.5.1-jruby spec/operawatir/watirspec_helper.rb
operawatir-0.5-jruby spec/operawatir/watirspec_helper.rb
operawatir-0.5.pre3-jruby spec/operawatir/watirspec_helper.rb
operawatir-0.5.pre2-jruby spec/operawatir/watirspec_helper.rb
operawatir-0.5.pre1-jruby spec/operawatir/watirspec_helper.rb