File: Rakefile

package info (click to toggle)
ruby-shoulda 4.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 300 kB
  • sloc: ruby: 784; sh: 45; makefile: 4
file content (31 lines) | stat: -rw-r--r-- 768 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require 'bundler/setup'
require 'bundler/gem_tasks'
require 'rake/testtask'
require 'pry-byebug'

require_relative 'test/support/current_bundle'

Rake::TestTask.new do |t|
  t.libs << 'test'
  t.ruby_opts += ['-w']
  t.pattern = 'test/**/*_test.rb'
  t.verbose = false
end

task :default do
  if Tests::CurrentBundle.instance.appraisal_in_use?
    Rake::Task['test'].invoke
  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 do
    appraisals = Tests::CurrentBundle.instance.available_appraisals
    puts "Valid appraisals: #{appraisals.join(', ')}"
  end
end