Permalink
Browse files

Split the generated Rakefile to use tasks/, and create the test_unit.…

…rake file.
  • Loading branch information...
1 parent 1d4703d commit 97ebf23fa297f1b583408b1029e6ac03155cc47e @avh4 avh4 committed Jul 5, 2008
View
@@ -20,6 +20,7 @@ rbiphonetest_generators/model/model_generator.rb
rbiphonetest_generators/model/templates/model.h
rbiphonetest_generators/model/templates/model.m
rbiphonetest_generators/model/templates/test.rb
+rbiphonetest_generators/model/templates/test_unit.rake
script/console
script/destroy
script/generate
@@ -64,5 +64,6 @@ def extract_options
BASEDIRS = %w(
Classes
test
+ tasks
)
end
@@ -1,14 +1,7 @@
require "rubygems"
require "rake"
-require "rake/testtask"
-task :default => :test
-
-Rake::TestTask.new do |t|
- t.libs << "test" << "test/bundles"
- t.test_files = FileList['test/test*.rb']
- t.verbose = true
-end
+Dir['tasks/**/*.rake'].each { |rake| load rake }
namespace :objc do
desc "Compiles all Objective-C bundles for testing"
@@ -17,11 +17,14 @@ def manifest
# Ensure appropriate folder(s) exists
m.directory 'Classes'
m.directory 'test'
+ m.directory 'tasks'
# Create stubs
m.template "model.h", "Classes/#{class_name}.h"
m.template "model.m", "Classes/#{class_name}.m"
m.template "test.rb", "test/test_#{name}.rb"
+ m.file "test_unit.rake", "tasks/test_unit.rake"
+
end
end
@@ -0,0 +1,9 @@
+require "rake/testtask"
+
+task :default => :test
+
+Rake::TestTask.new do |t|
+ t.libs << "test" << "test/bundles"
+ t.test_files = FileList['test/test*.rb']
+ t.verbose = true
+end
@@ -31,9 +31,11 @@ def test_generator_without_options
run_generator('model', [name], sources)
assert_directory_exists "Classes"
assert_directory_exists "test"
+ assert_directory_exists "tasks"
assert_generated_file "Classes/MyModel.h"
assert_generated_file "Classes/MyModel.m"
assert_generated_file "test/test_my_model.rb"
+ assert_generated_file "tasks/test_unit.rake"
end
private
@@ -29,6 +29,7 @@ def test_generator_without_options
run_generator('rbiphonetest', [APP_ROOT], sources)
assert_directory_exists "Classes"
assert_directory_exists "test"
+ assert_directory_exists "tasks"
assert_generated_file ".autotest"
assert_generated_file "Rakefile"
assert_generated_file "test/test_helper.rb"

0 comments on commit 97ebf23

Please sign in to comment.