Sha256: e8bfde1e3b96eda8dcf85d3aa973ac6f0946fe305730ab8cce6c2108b8b217f3

Contents?: true

Size: 1.08 KB

Versions: 3

Compression:

Stored size: 1.08 KB

Contents

require 'spec_helper'

class PageDefinition
  include Fluent
end

describe Fluent do
  let(:watir_browser)    { mock_browser_for_watir }
  let(:selenium_browser) { mock_browser_for_selenium }
  
  let(:watir_definition) { PageDefinition.new(watir_browser) }
  let(:selenium_definition) { PageDefinition.new(selenium_browser) }

  context 'a definition using watir-webdriver' do
    it 'should return a watir platform object' do
      watir_definition.platform.should be_kind_of Fluent::Platforms::WatirWebDriver::PlatformObject
    end
  end

  context 'a definition using selenium-webdriver' do
    it 'should return a selenium platform object' do
      selenium_definition.platform.should be_kind_of Fluent::Platforms::SeleniumWebDriver::PlatformObject
    end
  end
  
  context 'a definition using an unrecognized driver' do
    it 'should raise an exception' do
      msg = 'Unable to create a platform object for unknown_browser.'
      expect { PageDefinition.new(:unknown_browser) }.to raise_error(Fluent::Errors::UnableToCreatePlatform, msg)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fluent-0.4.0 spec/platform_object_spec.rb
fluent-0.3.0 spec/platform_object_spec.rb
fluent-0.2.0 spec/platform_object_spec.rb