Skip to content
This repository has been archived by the owner on Jan 11, 2022. It is now read-only.

Commit

Permalink
Add default UIDriver#url implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
jwilger committed Mar 25, 2012
1 parent d07ae82 commit 01a8efe
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/kookaburra/ui_driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ def initialize(configuration)
@configuration = configuration
end

# Returns the URL for this {UIDriver}.
#
# This implementation simply returns the
# {Kookaburra::Configuration#app_host}, but you might override it if you are
# using sub-drivers (see {.ui_driver}) and want them to be addressable.
def url
@configuration.app_host
end

protected

# @attribute [r] address_bar
Expand Down
8 changes: 8 additions & 0 deletions spec/kookaburra/ui_driver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@
end
end

describe '#url' do
it 'returns the configured app_host' do
config = stub('Configuration', :app_host => 'http://my.example.com')
driver = Kookaburra::UIDriver.new(config)
driver.url.should == 'http://my.example.com'
end
end

it_behaves_like :it_can_make_assertions do
let(:subject) { Kookaburra::UIDriver.new(stub('Configuration')) }
end
Expand Down

0 comments on commit 01a8efe

Please sign in to comment.