Created
May 11, 2011 15:48
-
-
Save andreastt/966721 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'operawatir' | |
describe OperaWatir do | |
before(:all) do | |
OperaWatir.api = 3 | |
@browser = OperaWatir::Browser.new | |
@browser.url = 'http://people.opera.com/weic/temp/wml.wml' | |
@window = @browser.active_window | |
end | |
shared_examples_for 'a title' do | |
it { should_not be_empty } | |
it { should_not be_kind_of(NilClass) } | |
it { should be_kind_of(String) } | |
it { should include 'Test' } | |
end | |
describe 'Collection' do | |
describe '#attr' do | |
subject { @window.card.attr(:title) } | |
it_behaves_like 'a title' | |
end | |
describe '#title' do | |
subject { @window.card.title } | |
it_behaves_like 'a title' | |
end | |
end | |
describe 'Window' do | |
describe '#title' do | |
subject { @window.title } | |
it_behaves_like 'a title' | |
end | |
end | |
describe 'Browser' do | |
describe '#driver' do | |
describe '#findElementsByTagName' do | |
describe '#getAttribute' do | |
subject { @browser.driver.findElementsByTagName('card').first.getAttribute('title') } | |
it_behaves_like 'a title' | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment