Permalink
Browse files

allow size-less system fonts

  • Loading branch information...
1 parent 74a7f4e commit 514b46d460e8d9cf6917b193b1e271750e8502a4 @clayallsopp clayallsopp committed Apr 6, 2013
Showing with 8 additions and 5 deletions.
  1. +3 −3 motion/font/font.rb
  2. +5 −2 spec/motion/font/font_spec.rb
View
@@ -2,15 +2,15 @@ module BubbleWrap
module Font
module_function
- def bold(size)
+ def bold(size = nil)
Font.new(:bold, size)
end
- def system(size)
+ def system(size = nil)
Font.new(:system, size)
end
- def italic(size)
+ def italic(size = nil)
Font.new(:italic, size)
end
@@ -2,8 +2,11 @@
[[:system, "systemFontOfSize:"], [:bold, "boldSystemFontOfSize:"], [:italic, "italicSystemFontOfSize:"]].each do |font, method|
describe ".#{font}" do
it "should work" do
- f = BubbleWrap::Font.send(font, 12)
- f.should == UIFont.send(method, 12)
+ f = BubbleWrap::Font.send(font, 16)
+ f.should == UIFont.send(method, 16)
+
+ f = BubbleWrap::Font.send(font)
+ f.should == UIFont.send(method, UIFont.systemFontSize)
end
end
end

0 comments on commit 514b46d

Please sign in to comment.