Sha256: b1532916395651f71a279f01128bd1a6078ca2b88b1e7d581e92b74bddb734cc

Contents?: true

Size: 1.16 KB

Versions: 6

Compression:

Stored size: 1.16 KB

Contents

require 'kookaburra/ui_driver'
require 'support/shared_examples/it_has_a_dependency_accessor'
require 'support/shared_examples/it_can_make_assertions'
require 'support/shared_examples/it_can_have_ui_components'

describe Kookaburra::UIDriver do
  it_behaves_like :it_can_have_ui_components, Kookaburra::UIDriver

  describe '.ui_driver' do
    it 'adds an accessor method for the named driver that defaults to an instance of the specified class' do
      foo_driver_class = mock(Class)
      foo_driver_class.should_receive(:new) \
        .with(:configuration) \
        .and_return(:a_foo_driver)

      ui_driver_class = Class.new(Kookaburra::UIDriver) do
        ui_driver :foo, foo_driver_class
      end

      ui = ui_driver_class.new(:configuration)
      ui.foo.should == :a_foo_driver
    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
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
kookaburra-1.2.0 spec/kookaburra/ui_driver_spec.rb
kookaburra-1.1.0 spec/kookaburra/ui_driver_spec.rb
kookaburra-1.0.0 spec/kookaburra/ui_driver_spec.rb
kookaburra-0.27.0 spec/kookaburra/ui_driver_spec.rb
kookaburra-0.26.1 spec/kookaburra/ui_driver_spec.rb
kookaburra-0.26.0 spec/kookaburra/ui_driver_spec.rb