Sha256: 3ddd3c908f1b9abd9671fb649eed872a0ccbe2cc215e1a5804ebc302b5a321f7

Contents?: true

Size: 713 Bytes

Versions: 1

Compression:

Stored size: 713 Bytes

Contents

require "bundler/gem_tasks"
require "rake/testtask"
require "rubocop/rake_task"

task default: %i[test]

TEST_WITH_OLD_AND_NEW_API = %w[
  validation/dry_validation call composition contract errors inherit module reform
  save skip_if populate validate form
].freeze

def dry_v_test_files
  dry_v_version = ENV.fetch("DRY_VALIDATION", "~> 0.13.0")
  api = dry_v_version.gsub("~>", "").to_f >= 1.0 ? "new" : "old"
  TEST_WITH_OLD_AND_NEW_API.map { |file| "test/#{file}_#{api}_api.rb" }
end

Rake::TestTask.new(:test) do |test|
  test.libs << "test"
  test.test_files = FileList["test/*_test.rb"] + FileList["test/validation/*_test.rb"] + dry_v_test_files
  test.verbose = true
end

RuboCop::RakeTask.new(:rubocop)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
reform-2.3.0.rc2 Rakefile