Sha256: 1ac19bcc0f6b6a9262ff95c251e235eff837a447c84d7af7e933bac4b4ac44f2

Contents?: true

Size: 640 Bytes

Versions: 2

Compression:

Stored size: 640 Bytes

Contents

shared Joybox::UI::Menu do
  before do
    @items = Array.new

    @items << MenuLabel.new(text: 'Label')
    @items << MenuLabel.new(text: 'Label2')
    @items << MenuLabel.new(text: 'Label3')
  end

  describe "Initialization" do
    it "should initialize with position & items" do 
      menu = Menu.new items: @items
      menu.children.count.should == @items.size
    end
  end

  it "should add new items" do
    menu = Menu.new items: @items
    menu.children.count.should == @items.size

    menu << MenuLabel.new(text: 'Label4')
    menu << MenuLabel.new(text: 'Label5')

    menu.children.count.should == @items.size + 2
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
joybox-1.1.1 spec/motion/joybox/ui/menu_spec.rb
joybox-1.1.0 spec/motion/joybox/ui/menu_spec.rb