Skip to content

Commit

Permalink
Add a functional test for XCodeTemplate with a rb_main.rb template
Browse files Browse the repository at this point in the history
  • Loading branch information
alloy committed Jun 26, 2010
1 parent d2b3ed8 commit 44fcccb
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/rucola/generators/xcode_template.rb
Expand Up @@ -51,7 +51,7 @@ def FULLUSERNAME

# Dummy stub
def ORGANIZATIONNAME
'__MyCompany__'
'__MyCompanyName__'
end

module Actions
Expand Down
6 changes: 3 additions & 3 deletions spec/fixtures/MacRuby Application/rb_main.rb
@@ -1,9 +1,9 @@
#
# rb_main.rb
# ÇPROJECTNAMEÈ
# ÇPROJECTNAMEÈ
#
# Created by ÇFULLUSERNAMEÈ on ÇDATEÈ.
# Copyright ÇORGANIZATIONNAMEÈ ÇYEARÈ. All rights reserved.
# Created by ÇFULLUSERNAMEÈ on ÇDATEÈ.
# Copyright ÇORGANIZATIONNAMEÈ ÇYEARÈ. All rights reserved.
#

# Loading the Cocoa framework. If you need to load more frameworks, you can
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/expected/Übercøøl/main.m
Expand Up @@ -3,7 +3,7 @@
// Übercøøl
//
// Created by Eloy Duran on 25-06-10.
// Copyright __MyCompany__ 2010. All rights reserved.
// Copyright __MyCompanyName__ 2010. All rights reserved.
//

#import <MacRuby/MacRuby.h>
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/expected/Übercøøl/rb_main.rb
@@ -1,6 +1,6 @@
#
# rb_main.rb
# †berc¿¿l
# Übercøøl
#
# Created by Eloy Duran on 25-06-10.
# Copyright __MyCompanyName__ 2010. All rights reserved.
Expand Down
15 changes: 12 additions & 3 deletions spec/functional/xcode_template_spec.rb
Expand Up @@ -16,6 +16,13 @@ def PROJECTNAME
template.render.should == expected
end

it "renders a XCode Info.plist template" do
template_file = fixture('MacRuby Application/Info.plist')
expected = read_fixture('expected/Übercøøl/Info.plist')
template = XCodeTemplate.new(XCodeTemplateContext.new, template_file)
template.render.should == expected
end

it "renders a XCode main.m template" do
Date.stubs(:today).returns(Date.new(2010, 6, 25))

Expand All @@ -25,9 +32,11 @@ def PROJECTNAME
template.render.should == expected
end

it "renders a XCode Info.plist template" do
template_file = fixture('MacRuby Application/Info.plist')
expected = read_fixture('expected/Übercøøl/Info.plist')
it "renders a XCode rb_main.rb template" do
Date.stubs(:today).returns(Date.new(2010, 6, 25))

template_file = fixture('MacRuby Application/rb_main.rb')
expected = read_fixture('expected/Übercøøl/rb_main.rb')
template = XCodeTemplate.new(XCodeTemplateContext.new, template_file)
template.render.should == expected
end
Expand Down

0 comments on commit 44fcccb

Please sign in to comment.