Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dump_schema_versions_mixin_spec.rb « postgresql_adapter « database « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 40e36bc02e9f4786eaa5c0b3e51ae409fafc9d40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Gitlab::Database::PostgresqlAdapter::DumpSchemaVersionsMixin do
  let(:instance_class) do
    klass = Class.new do
      def dump_schema_information
        original_dump_schema_information
      end

      def original_dump_schema_information
      end
    end

    klass.prepend(described_class)

    klass
  end

  let(:instance) { instance_class.new }

  it 'calls SchemaMigrations touch_all and skips original implementation' do
    expect(Gitlab::Database::SchemaMigrations).to receive(:touch_all).with(instance)
    expect(instance).not_to receive(:original_dump_schema_information)

    instance.dump_schema_information
  end
end