diff options
Diffstat (limited to 'spec/support/matchers/background_migrations_matchers.rb')
-rw-r--r-- | spec/support/matchers/background_migrations_matchers.rb | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/spec/support/matchers/background_migrations_matchers.rb b/spec/support/matchers/background_migrations_matchers.rb index 1057639beec..b471323dd72 100644 --- a/spec/support/matchers/background_migrations_matchers.rb +++ b/spec/support/matchers/background_migrations_matchers.rb @@ -67,17 +67,6 @@ end RSpec::Matchers.define :have_scheduled_batched_migration do |table_name: nil, column_name: nil, job_arguments: [], **attributes| define_method :matches? do |migration| - # Default arguments passed by BatchedMigrationWrapper (values don't matter here) - expect(migration).to be_background_migration_with_arguments([ - _start_id = 1, - _stop_id = 2, - table_name, - column_name, - _sub_batch_size = 10, - _pause_ms = 100, - *job_arguments - ]) - batched_migrations = Gitlab::Database::BackgroundMigration::BatchedMigration .for_configuration(migration, table_name, column_name, job_arguments) @@ -94,3 +83,11 @@ RSpec::Matchers.define :have_scheduled_batched_migration do |table_name: nil, co expect(batched_migrations.count).to be(0) end end + +RSpec::Matchers.define :be_finalize_background_migration_of do |migration| + define_method :matches? do |klass| + expect_next_instance_of(klass) do |instance| + expect(instance).to receive(:finalize_background_migration).with(migration) + end + end +end |