Sha256: 2230e9f4465cc6730a121bc8814f980e4a9d85ff445bb515a1a3987f2f99bf0b

Contents?: true

Size: 1.29 KB

Versions: 10

Compression:

Stored size: 1.29 KB

Contents

require 'spec_helper'

describe Wombat::Property::Locators::Factory do
	it 'should instantiate correct locator according to property type' do
		Wombat::Property::Locators::Factory.locator_for(Wombat::DSL::Property.new(nil, nil, :text)).should be_a(Wombat::Property::Locators::Text)
		Wombat::Property::Locators::Factory.locator_for(Wombat::DSL::Property.new(nil, nil, :html)).should be_a(Wombat::Property::Locators::Html)
		Wombat::Property::Locators::Factory.locator_for(Wombat::DSL::Property.new(nil, nil, :list)).should be_a(Wombat::Property::Locators::List)
		Wombat::Property::Locators::Factory.locator_for(Wombat::DSL::Property.new(nil, nil, :follow)).should be_a(Wombat::Property::Locators::Follow)
		Wombat::Property::Locators::Factory.locator_for(Wombat::DSL::Property.new(nil, nil, :iterator)).should be_a(Wombat::Property::Locators::Iterator)
		Wombat::Property::Locators::Factory.locator_for(Wombat::DSL::Property.new(nil, nil, :container)).should be_a(Wombat::Property::Locators::PropertyGroup)
	end

	it 'should raise correct exception if provided property is of unknown type' do
		lambda {
			Wombat::Property::Locators::Factory.locator_for(Wombat::DSL::Property.new(nil, nil, :weird))
		}.should raise_error(Wombat::Property::Locators::UnknownTypeException, "Unknown property format weird.")
	end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
wombat-2.4.0 spec/property/locators/factory_spec.rb
wombat-2.3.0 spec/property/locators/factory_spec.rb
wombat-2.2.1 spec/property/locators/factory_spec.rb
wombat-2.2.0 spec/property/locators/factory_spec.rb
wombat-2.1.3 spec/property/locators/factory_spec.rb
wombat-2.1.2 spec/property/locators/factory_spec.rb
wombat-2.1.1 spec/property/locators/factory_spec.rb
wombat-2.1.0 spec/property/locators/factory_spec.rb
wombat-2.0.1 spec/property/locators/factory_spec.rb
wombat-2.0.0 spec/property/locators/factory_spec.rb