mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-16 17:30:43 -07:00
Test migration parity using existing integration tests
This commit is contained in:
@@ -5,7 +5,7 @@ require 'rake/testtask'
|
||||
$LOAD_PATH.unshift(File.expand_path("../lib", __FILE__))
|
||||
require "liquid/version"
|
||||
|
||||
task(default: [:test, :rubocop])
|
||||
task(default: [:test, "test:migrator_integration", :rubocop])
|
||||
|
||||
desc('run test suite with default parser')
|
||||
Rake::TestTask.new(:base_test) do |t|
|
||||
@@ -33,6 +33,23 @@ task :rubocop do
|
||||
end
|
||||
end
|
||||
|
||||
namespace :test do
|
||||
task :migrator_integration do
|
||||
ENV['LIQUID_MIGRATOR'] = '1'
|
||||
original_parse_mode = ENV['LIQUID_PARSER_MODE']
|
||||
begin
|
||||
Rake::Task['integration_test'].reenable
|
||||
["lax", "strict"].each do |parse_mode|
|
||||
ENV['LIQUID_PARSER_MODE'] = parse_mode
|
||||
Rake::Task['integration_test'].invoke
|
||||
Rake::Task['integration_test'].reenable
|
||||
end
|
||||
ensure
|
||||
ENV['LIQUID_PARSER_MODE'] = original_parse_mode
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
desc('runs test suite with both strict and lax parsers')
|
||||
task :test do
|
||||
ENV['LIQUID_PARSER_MODE'] = 'lax'
|
||||
|
||||
Reference in New Issue
Block a user