Sha256: f3d0c557573b7b06915517d5c54cf6fb6867d801e0168dacd2a5f4d62e9a0241

Contents?: true

Size: 748 Bytes

Versions: 6

Compression:

Stored size: 748 Bytes

Contents

shared_examples_for :it_can_have_ui_components do |subject_class|
  describe '.ui_component' do
    it 'adds an accessor method for the named component that defaults to an instance of the specified class' do
      configuration = double('Kookaburra::Configuration').as_null_object
      foo_component_class = double(Class)
      foo_component_class.should_receive(:new) \
        .with(configuration, :option => :value) \
        .and_return(:a_foo_component)

      component_container_class = Class.new(subject_class) do
        ui_component :foo, foo_component_class, :option => :value
      end

      component_container = component_container_class.new(configuration)
      component_container.foo.should == :a_foo_component
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
kookaburra-2.0.0 spec/support/shared_examples/it_can_have_ui_components.rb
kookaburra-1.3.1 spec/support/shared_examples/it_can_have_ui_components.rb
kookaburra-1.3.0 spec/support/shared_examples/it_can_have_ui_components.rb
kookaburra-1.2.3 spec/support/shared_examples/it_can_have_ui_components.rb
kookaburra-1.2.2 spec/support/shared_examples/it_can_have_ui_components.rb
kookaburra-1.2.1 spec/support/shared_examples/it_can_have_ui_components.rb