Sha256: 801e5acccdf086e8d9d506240c54c13522c9894a7290cb8b7f1543107e956fe3

Contents?: true

Size: 667 Bytes

Versions: 1

Compression:

Stored size: 667 Bytes

Contents

require File.join(File.dirname(__FILE__), '..', 'test_helper')

class WidgetTest < ActiveSupport::TestCase
  context "#has_widgets in class context" do
    setup do
      @mum = Class.new(MouseCell) do
        has_widgets do |me|
          me << widget('mouse_cell', 'baby', :squeak)
        end
      end.new('mum', :squeak)
      
      @kid = Class.new(@mum.class).new('mum', :squeak)
    end
    
    should "setup the widget family at creation time" do
      assert_equal 1, @mum.children.size
      assert_kind_of Apotomo::StatefulWidget, @mum['baby']
    end
    
    should "not inherit trees for now" do
      assert_equal [], @kid.children
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
apotomo-0.1.1 test/unit/widget_test.rb