Sha256: 681dcc0053d4d0224b542cd7f26c7c0c5d689a72be4c1267a7674eb2c3d36a8a

Contents?: true

Size: 1.17 KB

Versions: 51

Compression:

Stored size: 1.17 KB

Contents

# encoding: utf-8
$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))

if ENV['coverage']
  raise "simplecov only works on Ruby 1.9" unless RUBY_VERSION =~ /^1\.9/

  require 'simplecov'
  SimpleCov.start { add_filter "spec/" }
end

require 'rspec'
require 'watir-webdriver'
require 'selenium-webdriver'

require 'page-object'

def mock_watir_browser
  watir_browser = double('watir')
  watir_browser.stub!(:is_a?).with(anything()).and_return(false)
  watir_browser.stub!(:is_a?).with(Watir::Browser).and_return(true)
  watir_browser
end


def mock_selenium_browser
  selenium_browser = double('selenium')
  selenium_browser.stub!(:is_a?).with(Watir::Browser).and_return(false)
  selenium_browser.stub!(:is_a?).with(Selenium::WebDriver::Driver).and_return(true)
  selenium_browser
end


def mock_adapter(browser, page_object)
  adapter = double('adapter')
  adapter.stub!(:is_for?).with(anything()).and_return false
  adapter.stub!(:is_for?).with(browser).and_return true
  adapter.stub!(:create_page_object).and_return page_object
  adapter
end

def mock_adapters(adapters)
  PageObject::Platforms.stub!(:get).and_return adapters
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
page-object-0.9.1 spec/spec_helper.rb
page-object-0.9.0 spec/spec_helper.rb
page-object-0.8.10 spec/spec_helper.rb
page-object-0.8.9 spec/spec_helper.rb
page-object-0.8.8 spec/spec_helper.rb
page-object-0.8.7 spec/spec_helper.rb
page-object-0.8.6.1 spec/spec_helper.rb
page-object-0.8.6 spec/spec_helper.rb
page-object-0.8.5 spec/spec_helper.rb
page-object-0.8.4 spec/spec_helper.rb
page-object-0.8.3 spec/spec_helper.rb
page-object-0.8.2 spec/spec_helper.rb
page-object-0.8.1 spec/spec_helper.rb
page-object-0.8 spec/spec_helper.rb
page-object-0.7.6 spec/spec_helper.rb
page-object-0.7.5.1 spec/spec_helper.rb
page-object-0.7.5 spec/spec_helper.rb
page-object-0.7.4 spec/spec_helper.rb
page-object-0.7.3 spec/spec_helper.rb
page-object-0.7.2 spec/spec_helper.rb