Sha256: 5d9d8c2a9ecb82af55837ff351836792823ce8218e3c5c2056815b460399b6e1

Contents?: true

Size: 1.41 KB

Versions: 13

Compression:

Stored size: 1.41 KB

Contents

describe MotionPrime::Section do

  describe "general" do
    before do
      @section = SampleSection.new(screen: @screen)
    end

    describe "#name" do
      it "should use class name by default" do
        @section.name.should == 'sample'
      end

      it "should use given name" do
        section = SampleSection.new(name: 'my_section')
        section.name.should == 'my_section'
      end
    end
  end

  describe "base section" do
    before do
      @screen = BaseScreen.new
      @section = SampleViewSection.new(screen: @screen)
      @section.render
    end

    describe "#element" do
      it "should return element by name" do
        @section.element(:description).is_a?(MotionPrime::BaseElement).should.be.true
      end
    end

    describe "#view" do
      it "should return view by element name" do
        @section.view(:description).is_a?(MPLabel).should.be.true
      end
    end
  end

  describe "draw section" do
    before do
      @screen = BaseScreen.new
      @section = SampleDrawSection.new(screen: @screen)
      @section.render
    end

    describe "#element" do
      it "should return element by name" do
        @section.element(:description).is_a?(MotionPrime::DrawElement).should.be.true
      end
    end

    describe "#view" do
      it "should return container view by element name" do
        @section.view(:description).is_a?(MPViewWithSection).should.be.true
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
motion-prime-1.0.7 spec/unit/sections/section_spec.rb
motion-prime-1.0.6 spec/unit/sections/section_spec.rb
motion-prime-1.0.5 spec/unit/sections/section_spec.rb
motion-prime-1.0.4 spec/unit/sections/section_spec.rb
motion-prime-1.0.3 spec/unit/sections/section_spec.rb
motion-prime-1.0.2 spec/unit/sections/section_spec.rb
motion-prime-1.0.1 spec/unit/sections/section_spec.rb
motion-prime-1.0.0 spec/unit/sections/section_spec.rb
motion-prime-0.9.9.2 spec/unit/sections/section_spec.rb
motion-prime-0.9.9.1 spec/unit/sections/section_spec.rb
motion-prime-0.9.9 spec/unit/sections/section_spec.rb
motion-prime-0.9.8 spec/unit/sections/section_spec.rb
motion-prime-0.9.7 spec/unit/sections/section_spec.rb