Permalink
Browse files

[merb_rspec] Fix for simple story generation.

  • Loading branch information...
1 parent 174b32f commit 2fc4927fb57755f50c25a79dbd0749112b60aebb @benburkert benburkert committed Feb 13, 2008
Showing with 45 additions and 1 deletion.
  1. +44 −0 merb_rspec/lib/merbtasks.rb
  2. +1 −1 merb_rspec/rspec_generators/story/story_generator.rb
@@ -0,0 +1,44 @@
+desc "Run all specs"
+Spec::Rake::SpecTask.new('specs') do |t|
+ t.spec_opts = ["--format", "specdoc", "--colour"]
+ t.spec_files = Dir['spec/**/*_spec.rb'].sort
+end
+
+desc "Run all model specs"
+Spec::Rake::SpecTask.new('model_specs') do |t|
+ t.spec_opts = ["--format", "specdoc", "--colour"]
+ t.spec_files = Dir['spec/models/**/*_spec.rb'].sort
+end
+
+desc "Run all controller specs"
+Spec::Rake::SpecTask.new('controller_specs') do |t|
+ t.spec_opts = ["--format", "specdoc", "--colour"]
+ t.spec_files = Dir['spec/controllers/**/*_spec.rb'].sort
+end
+
+desc "Run a specific spec with TASK=xxxx"
+Spec::Rake::SpecTask.new('spec') do |t|
+ t.spec_opts = ["--format", "specdoc", "--colour"]
+ t.libs = ['lib', 'server/lib' ]
+ t.spec_files = ["spec/#{ENV['TASK']}_spec.rb"]
+end
+
+desc "Run all specs output html"
+Spec::Rake::SpecTask.new('specs_html') do |t|
+ t.spec_opts = ["--format", "html"]
+ t.libs = ['lib', 'server/lib' ]
+ t.spec_files = Dir['spec/**/*_spec.rb'].sort
+end
+
+desc "RCov"
+Spec::Rake::SpecTask.new('rcov') do |t|
+ t.spec_opts = ["--format", "specdoc", "--colour"]
+ t.spec_files = Dir['spec/**/*_spec.rb'].sort
+ t.libs = ['lib', 'server/lib' ]
+ t.rcov = true
+end
+
+desc "Run the given story. rake story[story_name]"
+task :story, :story_name do |t,args|
+ sh %{ruby stories/stories/#{args.story_name}.rb}
+end
@@ -28,7 +28,7 @@ def manifest
m.dependency "merb_story_setup", [""]
end
- m.directory File.join("stories", "stories", self.story_path)
+ m.directory File.join("stories", "stories", self.story_path) unless self.story_path.nil?
copy_dirs
copy_files

0 comments on commit 2fc4927

Please sign in to comment.