aboutsummaryrefslogtreecommitdiffstats
path: root/Rakefile
diff options
context:
space:
mode:
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile37
1 files changed, 31 insertions, 6 deletions
diff --git a/Rakefile b/Rakefile
index b1fc74a13c..17a6f8d35d 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,15 +1,40 @@
require 'rubygems'
require 'spec/rake/spectask'
-Spec::Rake::SpecTask.new do |t|
- t.spec_files = FileList['spec/**/*_spec.rb']
-end
+spec_file_list = FileList['spec/**/*_spec.rb']
+desc "Run specs using RCov (uses mysql database adapter)"
Spec::Rake::SpecTask.new(:coverage) do |t|
- t.spec_files = FileList['spec/**/*_spec.rb']
+ t.spec_files =
+ ["spec/connections/mysql_connection.rb"] +
+ spec_file_list
+
t.rcov = true
- t.rcov_opts = ['-x', 'spec,gems']
+ t.rcov_opts << '--exclude' << "spec,gems"
+ t.rcov_opts << '--text-summary'
+ t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
+ t.rcov_opts << '--only-uncovered'
+end
+
+namespace :spec do
+ for adapter in %w[mysql sqlite3 postgresql]
+ desc "Run specs with the #{adapter} database adapter"
+ Spec::Rake::SpecTask.new(adapter) do |t|
+ t.spec_files =
+ ["spec/connections/#{adapter}_connection.rb"] +
+ ["spec/schemas/#{adapter}_schema.rb"] +
+ spec_file_list
+ end
+ end
end
+desc "Run specs with mysql and sqlite3 database adapters (default)"
+task :spec => ["spec:sqlite3", "spec:mysql", "spec:postgresql"]
+
desc "Default task is to run specs"
-task :default => :spec \ No newline at end of file
+task :default => :spec
+
+desc 'Removes trailing whitespace'
+task :whitespace do
+ sh %{find . -name '*.rb' -exec sed -i '' 's/ *$//g' {} \\;}
+end