spec/ios/apply_styles_spec.rb in motion-kit-0.10.11 vs spec/ios/apply_styles_spec.rb in motion-kit-0.11.0

- old
+ new

@@ -1,22 +1,37 @@ describe "Layouts automatically apply styles" do before do - @subject = TestApplyStyles.new + @subject = TestApplyStyles.new.build end - it "should call all style methods" do - @subject.view - @subject.did_call_logo.should == true - @subject.did_call_h1_label.should == true - @subject.did_call_label.should == true + describe "should call all style methods" do + { + logo: -> { @subject.did_call_logo }, + h1_label: -> { @subject.did_call_h1_label }, + label: -> { @subject.did_call_label }, + }.each do |name, condition| + it "should call #{name} style method" do + condition.call.should == true + end + end end - it "should apply all styles" do - @subject.get(:logo).text.should == 'MK' - @subject.get(:label).text.should == ':label' - @subject.get(:label).numberOfLines.should == 2 - @subject.get(:label).font.pointSize.should == 16 - @subject.get(:label).textColor.should == UIColor.blackColor + describe "should apply all styles" do + it 'should style :logo' do + @subject.get(:logo).text.should == 'MK' + end + it 'should style :label' do + @subject.get(:label).text.should == ':label' + end + it 'should style :label' do + @subject.get(:label).numberOfLines.should == 2 + end + it 'should style :label' do + @subject.get(:label).font.pointSize.should == 16 + end + it 'should style :label' do + @subject.get(:label).textColor.should == UIColor.blackColor + end end end