Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 49 lines (42 sloc) 1.524 kB
53054c0 @brynary Adding jeweler for gem management
brynary authored
1 require "rubygems"
960bbcb initial import
Nick Kallen authored
2
53054c0 @brynary Adding jeweler for gem management
brynary authored
3 begin
dbb2dcf @brynary Gracefully handle case where RSpec is not installed in Rakefile
brynary authored
4 require "spec/rake/spectask"
5 rescue LoadError
6 desc "Run specs"
7 task(:spec) { $stderr.puts '`gem install rspec` to run specs' }
8 else
9 desc "Run specs using RCov (uses mysql database adapter)"
10 Spec::Rake::SpecTask.new(:coverage) do |t|
11 t.spec_files =
12 ["spec/connections/mysql_connection.rb"] +
13 FileList['spec/**/*_spec.rb']
14
15 t.rcov = true
16 t.rcov_opts << '--exclude' << "spec,gems"
17 t.rcov_opts << '--text-summary'
18 t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
19 t.rcov_opts << '--only-uncovered'
20 end
124b104 @brynary Add rake task for coverage
brynary authored
21
dbb2dcf @brynary Gracefully handle case where RSpec is not installed in Rakefile
brynary authored
22 namespace :spec do
20a10e5 @rsim changes for Oracle support - OracleCompiler and corresponding tests w…
rsim authored
23 for adapter in %w[mysql sqlite3 postgresql oracle]
dbb2dcf @brynary Gracefully handle case where RSpec is not installed in Rakefile
brynary authored
24 desc "Run specs with the #{adapter} database adapter"
25 Spec::Rake::SpecTask.new(adapter) do |t|
0da3bbe @brynary Adding spec.opts
brynary authored
26 t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""]
dbb2dcf @brynary Gracefully handle case where RSpec is not installed in Rakefile
brynary authored
27 t.libs << "#{File.dirname(__FILE__)}/vendor/rails/activerecord/lib"
28 t.libs << "#{File.dirname(__FILE__)}/spec"
20a10e5 @rsim changes for Oracle support - OracleCompiler and corresponding tests w…
rsim authored
29 # t.warning = true
dbb2dcf @brynary Gracefully handle case where RSpec is not installed in Rakefile
brynary authored
30 t.spec_files =
31 ["spec/connections/#{adapter}_connection.rb"] +
32 ["spec/schemas/#{adapter}_schema.rb"] +
33 FileList['spec/**/*_spec.rb']
34 end
49d119a @brynary Adding spec:mysql and spec:sqlite3 tasks
brynary authored
35 end
36 end
37
dbb2dcf @brynary Gracefully handle case where RSpec is not installed in Rakefile
brynary authored
38 desc "Run specs with mysql and sqlite3 database adapters (default)"
34e35c7 @brynary Rake check_dependencies is dead. Don't try to run it
brynary authored
39 task :spec => ["spec:sqlite3", "spec:mysql", "spec:postgresql"]
49d119a @brynary Adding spec:mysql and spec:sqlite3 tasks
brynary authored
40
dbb2dcf @brynary Gracefully handle case where RSpec is not installed in Rakefile
brynary authored
41 desc "Default task is to run specs"
42 task :default => :spec
43 end
2753d8f @brynary Add rake whitespace
brynary authored
44
45 desc 'Removes trailing whitespace'
46 task :whitespace do
47 sh %{find . -name '*.rb' -exec sed -i '' 's/ *$//g' {} \\;}
48 end
Something went wrong with that request. Please try again.