Skip to content

Commit

Permalink
allow size-less system fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
clayallsopp committed Apr 6, 2013
1 parent 74a7f4e commit 514b46d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions motion/font/font.rb
Expand Up @@ -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

Expand Down
7 changes: 5 additions & 2 deletions spec/motion/font/font_spec.rb
Expand Up @@ -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
Expand Down

0 comments on commit 514b46d

Please sign in to comment.