Module: MonarchMigrate::Testing::Helpers

Includes:
ActiveSupport::Testing::Stream
Included in:
RSpec, TestUnit
Defined in:
lib/monarch_migrate/testing.rb

Instance Method Summary collapse

Instance Method Details

#data_migrationObject



11
12
13
14
15
16
17
18
19
# File 'lib/monarch_migrate/testing.rb', line 11

def data_migration
  @data_migration ||=
    begin
      filename = data_migration_basename
      migrator
        .migrations
        .find(method(:not_found)) { |m| m.filename.ends_with?(filename) }
    end
end

#run_data_migrationObject



21
22
23
24
# File 'lib/monarch_migrate/testing.rb', line 21

def run_data_migration
  output = capture(:stdout) { data_migration.run }
  ensure_no_error(output)
end