spec/spec_helper.rb in page-object-1.0.3 vs spec/spec_helper.rb in page-object-1.1.0
- old
+ new
@@ -23,20 +23,22 @@
end
def mock_selenium_browser
selenium_browser = double('selenium')
- allow(selenium_browser).to receive(:is_a?).with(Watir::Browser).and_return(false)
+ allow(selenium_browser).to receive(:is_a?).with(anything).and_return(false)
allow(selenium_browser).to receive(:is_a?).with(Selenium::WebDriver::Driver).and_return(true)
selenium_browser
end
def mock_adapter(browser, page_object)
adapter = double('adapter')
allow(adapter).to receive(:is_for?).with(anything()).and_return false
allow(adapter).to receive(:is_for?).with(browser).and_return true
allow(adapter).to receive(:create_page_object).and_return page_object
+ allow(adapter).to receive(:root_element_for).and_return browser
+ allow(adapter).to receive(:browser_for).and_return browser
adapter
end
def mock_adapters(adapters)
allow(PageObject::Platforms).to receive(:get).and_return adapters