spec/nsstring_spec.rb in sugarcube-0.16.5 vs spec/nsstring_spec.rb in sugarcube-0.16.9

- old
+ new

@@ -46,9 +46,29 @@ ((color.red * 2).round / 2.0).should == 0.5 ((color.green * 2).round / 2.0).should == 0.5 ((color.blue * 2).round / 2.0).should == 0.5 end + it "should have a #uilabel method" do + str = 'test' + str_size = str.sizeWithFont(UIFont.systemFontOfSize(UIFont.labelFontSize)) + label = str.uilabel + label.size.width == str_size.width + label.size.height == str_size.height + label.backgroundColor == UIColor.clearColor + end + + it "should have a #uilabel(font) method" do + str = 'test' + font = UIFont.boldSystemFontOfSize(20) + str_size = str.sizeWithFont(font) + label = str.uilabel(font) + label.font.should == font + label.size.width == str_size.width + label.size.height == str_size.height + label.backgroundColor == UIColor.clearColor + end + it "should have a #escape_url method" do ' '.escape_url.should == '%20' '?<>&=;%'.escape_url.should == '%3F%3C%3E%26%3D%3B%25' end