Skip to content

Commit

Permalink
Modified rakefile to run clearance_stories generator
Browse files Browse the repository at this point in the history
  • Loading branch information
eugenebolshakov authored and jferris committed Feb 2, 2009
1 parent 7212448 commit bcc61fe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
17 changes: 12 additions & 5 deletions Rakefile
Expand Up @@ -3,6 +3,7 @@ require 'rake/testtask'
require 'cucumber/rake/task'

test_files_pattern = 'test/rails_root/test/{unit,functional,other}/**/*_test.rb'

namespace :test do
Rake::TestTask.new(:all => ['generator:cleanup', 'generator:generate']) do |task|
task.libs << 'lib'
Expand All @@ -16,12 +17,16 @@ namespace :test do
end
end

generators = %w(clearance clearance_stories)

namespace :generator do
desc "Cleans up the test app before running the generator"
task :cleanup do
FileList["generators/clearance/templates/**/*.*"].each do |each|
file = "test/rails_root/#{each.gsub("generators/clearance/templates/",'')}"
File.delete(file) if File.exists?(file)
generators.each do |generator|
FileList["generators/#{generator}/templates/**/*.*"].each do |each|
file = "test/rails_root/#{each.gsub("generators/#{generator}/templates/",'')}"
File.delete(file) if File.exists?(file)
end
end

FileList["test/rails_root/db/**/*"].each do |each|
Expand All @@ -31,10 +36,12 @@ namespace :generator do
system "mkdir -p test/rails_root/vendor/plugins/clearance"
system "cp -R generators test/rails_root/vendor/plugins/clearance"
end

desc "Run the generator on the tests"
task :generate do
system "cd test/rails_root && ./script/generate clearance"
generators.each do |generator|
system "cd test/rails_root && ./script/generate #{generator}"
end
end
end

Expand Down
@@ -1,4 +1,4 @@
class ClearanceGenerator < Rails::Generator::Base
class ClearanceStoriesGenerator < Rails::Generator::Base

def manifest
record do |m|
Expand Down

0 comments on commit bcc61fe

Please sign in to comment.