Rakefile in identity_cache-0.5.1 vs Rakefile in identity_cache-1.0.0

- old
+ new

@@ -1,24 +1,33 @@ #!/usr/bin/env rake +# frozen_string_literal: true require 'bundler/gem_tasks' require 'rake/testtask' require 'rdoc/task' -desc 'Default: run unit tests.' -task :default => :test +desc('Default: run tests and style checks.') +task(default: [:test, :rubocop]) -desc 'Test the identity_cache plugin.' +desc('Test the identity_cache plugin.') Rake::TestTask.new(:test) do |t| t.libs << 'lib' t.libs << 'test' t.pattern = 'test/**/*_test.rb' t.verbose = true end -desc 'Update serialization format test fixture.' +task :rubocop do + require 'rubocop/rake_task' + RuboCop::RakeTask.new +end + +desc('Update serialization format test fixture.') task :update_serialization_format do - ruby './test/helpers/update_serialization_format.rb' + %w(mysql2 postgresql).each do |db| + ENV["DB"] = db + ruby './test/helpers/update_serialization_format.rb' + end end namespace :benchmark do desc "Run the identity cache CPU benchmark" task :cpu do