Renamed helpers to correspond to renamed Controller classes.
[merb_radiant.git] / radiant_extensions_plugins / plugins / scenarios / .svn / text-base / Rakefile.svn-base
blob4b015796337378da6f333acc5bd0c4e33a37484c
1 require File.expand_path("#{File.dirname(__FILE__)}/testing/environment")
3 TESTING_ENVIRONMENTS["rspec_3119_rails_8375"].load
4 require 'rake/rdoctask'
5 require 'rake/testtask'
6 require "spec/rake/spectask"
8 spec_tasks = []
9 test_tasks = []
10 TESTING_ENVIRONMENTS.each do |env|
11   namespace env.name do
12     env.databases.each do |database|
13       
14       namespace database do
15         task :prepare do
16           content = %Q{TESTING_ENVIRONMENT = '#{env.name}'\nDATABASE_ADAPTER = '#{database}'}
17           File.open("#{SUPPORT_TEMP}/environment.rb", "w") {|f| f.puts content}
18           puts content
19         end
20         
21         if env.name =~ /^rspec/ # We can't use rspec if the environment doesn't support it
22           desc "Run specs in environment '#{env.name}' using database '#{database}'"
23           Spec::Rake::SpecTask.new(:spec => "#{env.name}:#{database}:prepare") do |t|
24             t.fail_on_error = false
25             t.spec_opts = ['--options', "\"#{SPEC_ROOT}/spec.opts\""]
26             t.spec_files = FileList["#{SUPPORT_TEMP}/environment.rb", "#{SPEC_ROOT}/**/*_spec.rb"]
27             t.verbose = false
28           end
29           spec_tasks << "#{env.name}:#{database}:spec"
30         end
31         
32         desc "Run tests in environment '#{env.name}' using database '#{database}'"
33         Rake::TestTask.new(:test => "#{env.name}:#{database}:prepare") do |t|
34           t.test_files = FileList["#{SUPPORT_TEMP}/environment.rb", "test/**/*_test.rb"]
35           t.verbose = false
36         end
37         test_tasks << "#{env.name}:#{database}:test"
38         
39       end
40     end
41   end
42 end
44 desc "Run specs in all environments"
45 task :spec do
46   spec_tasks.each do |task|
47     system "rake '#{task}'"
48   end
49 end
51 desc "Run tests in all environments"
52 task :test do
53   test_tasks.each do |task|
54     system "rake '#{task}'"
55   end
56 end
58 Rake::RDocTask.new(:doc) do |r|
59   r.title = "Rails Scenarios Plugin"
60   r.main = "README"
61   r.options << "--line-numbers"
62   r.rdoc_files.include("README", "LICENSE", "lib/**/*.rb")
63   r.rdoc_dir = "doc"
64 end
66 task :default => [:spec, :test]