Sha256: 8f7ad45b8b3d302605e834b4fc7d8c663dabc716d50a412d12cf68e7934c1139
Contents?: true
Size: 1.71 KB
Versions: 20
Compression:
Stored size: 1.71 KB
Contents
describe 'Simple Layout' do before do @subject = TestLayout.new.build end it "should be an instance of MotionKit::Layout" do @subject.should.be.kind_of(MotionKit::Layout) end it "should be an instance of MK::Layout" do @subject.should.be.kind_of(MK::Layout) end it "should add a UIView subview with the name :basic_view" do view = @subject.get(:basic_view) view.should.be.kind_of(UIView) end it "should add two subviews under :basic_view" do @subject.view.subviews.first.subviews.length.should == 2 end it "should add a UIButton as the first subview under :basic_view" do @subject.view.subviews.first.subviews.first.should.be.kind_of UIButton end it "should add a UILabel as the second subview under :basic_view" do @subject.view.subviews.first.subviews[1].should.be.kind_of UILabel end it "should allow getting the subviews by their id" do @subject.get(:basic_view).should.be.kind_of UIView @subject.get(:basic_button).should.be.kind_of UIButton @subject.get(:basic_label).should.be.kind_of UILabel end it "should allow getting the subviews by first, last and nth child" do @subject.first(:repeated_label_3).should == @subject.first_view @subject.nth(:repeated_label_3, 3).should == @subject.nth_view @subject.last(:repeated_label_3).should == @subject.last_view end it "should allow getting all the subviews by name" do views = @subject.all(:repeated_label_3) views.length.should > 1 views[0].should.be.kind_of UIView views[3].should.be.kind_of UIButton views[-1].should.be.kind_of UILabel end it "should support missing methods" do -> do @subject.foo_bar_baz end.should.raise(NoMethodError) end end
Version data entries
20 entries across 14 versions & 1 rubygems