1
0
Fork 0
mirror of https://github.com/thoughtbot/shoulda-matchers.git synced 2022-11-09 12:01:38 -05:00
thoughtbot--shoulda-matchers/Rakefile
Kapil Sachdev b7e02184d9 fix(rubocop): Fix Layout/LineLength
- bump rubocop to v1.0
- Fix Layout/MultilineAssignmentLayout and other remaining offences
- Exculde appraisal generated gemfiles in rubocop
- Replace NON_NUMERIC_VALUE constant with instance method against 
failing test case in  rails <= 5.1 and postgres adapter.
This is a defect in rails where a frozen string is modified in 
https://github.com/rails/rails/blob/v5.1.7/activerecord/lib/active_record/connection_adapters/postgresql/oid/money.rb#L25
2020-11-03 10:05:25 -07:00

44 lines
1.3 KiB
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'
require_relative 'spec/support/tests/current_bundle'
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 Tests::CurrentBundle.instance.appraisal_in_use?
sh 'rake spec:unit --trace'
sh 'rake spec:acceptance --trace'
elsif ENV['CI']
exec 'appraisal install && appraisal rake --trace'
else
appraisal = Tests::CurrentBundle.instance.latest_appraisal
exec "appraisal install && appraisal #{appraisal} rake --trace"
end
end
namespace :appraisal do
task list: :environment do
appraisals = Tests::CurrentBundle.instance.available_appraisals
puts "Valid appraisals: #{appraisals.join(', ')}"
end
end
Shoulda::Matchers::DocumentationTasks.create
task release: 'docs:publish_latest'