mirror of
https://github.com/thoughtbot/shoulda-matchers.git
synced 2022-11-09 12:01:38 -05:00
72f60fae94
When running tests, you can now switch between running them against a SQLite or PostgreSQL database. This is accomplished by modifying the unit and acceptance tests so that when they generate and load the test Rails application, database.yml is replaced with content that will configure the database appropriately.
37 lines
920 B
Ruby
37 lines
920 B
Ruby
require 'bundler/setup'
|
|
require 'bundler/gem_tasks'
|
|
require 'rspec/core/rake_task'
|
|
require 'appraisal'
|
|
require_relative 'tasks/documentation'
|
|
require_relative 'spec/support/tests/database'
|
|
|
|
RSpec::Core::RakeTask.new('spec:unit') do |t|
|
|
t.ruby_opts = '-w -r ./spec/report_warnings'
|
|
t.pattern = "spec/unit/**/*_spec.rb"
|
|
t.rspec_opts = '--color --format progress'
|
|
t.verbose = false
|
|
end
|
|
|
|
RSpec::Core::RakeTask.new('spec:acceptance') do |t|
|
|
t.ruby_opts = '-w -r ./spec/report_warnings'
|
|
t.pattern = "spec/acceptance/**/*_spec.rb"
|
|
t.rspec_opts = '--color --format progress'
|
|
t.verbose = false
|
|
end
|
|
|
|
task :default do
|
|
if ENV['BUNDLE_GEMFILE'] =~ /gemfiles/
|
|
sh 'rake spec:unit'
|
|
sh 'rake spec:acceptance'
|
|
else
|
|
Rake::Task['appraise'].invoke
|
|
end
|
|
end
|
|
|
|
task :appraise do
|
|
exec 'appraisal install && appraisal rake'
|
|
end
|
|
|
|
Shoulda::Matchers::DocumentationTasks.create
|
|
|
|
task release: 'docs:publish_latest'
|