Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 38 lines (33 sloc) 1.087 kb
015d53a @mislav setup continuous integration testing with Travis-CI
authored
1 begin
2 require 'rspec/core/rake_task'
3 rescue LoadError
4 # no spec tasks
5 else
db32fcf @mislav try to fix travis build
authored
6 task :default => [:create_database, :spec]
d882efc @mislav cleanup loading in Rakefile
authored
7
015d53a @mislav setup continuous integration testing with Travis-CI
authored
8 desc 'Run ALL OF the specs'
9 RSpec::Core::RakeTask.new(:spec) do |t|
10 # t.ruby_opts = '-w'
11 t.pattern = 'spec/finders/active_record_spec.rb' if ENV['DB'] and ENV['DB'] != 'sqlite3'
f703f88 @mislav Rails 3.1, RSpec 2 compatibility
authored
12 end
13
015d53a @mislav setup continuous integration testing with Travis-CI
authored
14 namespace :spec do
15 desc "Run Rails specs"
16 RSpec::Core::RakeTask.new(:rails) do |t|
17 t.pattern = %w'spec/finders/active_record_spec.rb spec/view_helpers/action_view_spec.rb'
18 end
19 end
079d0d8 Awesome new features, supersmart tests, great coverage!
mislav authored
20 end
1464c8b @mislav gemify
authored
21
db32fcf @mislav try to fix travis build
authored
22 desc 'Create necessary databases'
23 task :create_database do |variable|
24 case ENV['DB']
25 when 'mysql', 'mysql2'
26 `mysql -e 'create database will_paginate;'`
27 abort "failed to create mysql database" unless $?.success?
28 when 'postgres'
29 `psql -c 'create database will_paginate;' -U postgres`
30 abort "failed to create postgres database" unless $?.success?
31 end
32 end
33
015d53a @mislav setup continuous integration testing with Travis-CI
authored
34 desc 'Run specs against both Rails 3.1 and Rails 3.0'
35 task :rails3 do |variable|
36 system 'bundle exec rake spec && BUNDLE_GEMFILE=Gemfile.rails3.0 bundle exec rake spec:rails'
d882efc @mislav cleanup loading in Rakefile
authored
37 end
Something went wrong with that request. Please try again.