Rakefile in reform-2.3.0.rc2 vs Rakefile in reform-2.3.1
- old
+ new
@@ -1,18 +1,18 @@
require "bundler/gem_tasks"
require "rake/testtask"
require "rubocop/rake_task"
+require "dry/types/version"
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"
+ api = Gem::Version.new(Dry::Types::VERSION).to_s.split('.').first.to_i >= 1 ? "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"