Sha256: 69de931f60d5f018d4b974146290863aee26d9d6107e6329e869c637263b48d6

Contents?: true

Size: 823 Bytes

Versions: 1

Compression:

Stored size: 823 Bytes

Contents

require 'spec_helper'
require 'fix_db_schema_conflicts/autocorrect_configuration'

RSpec.describe FixDBSchemaConflicts::AutocorrectConfiguration do
  subject(:autocorrect_config) { described_class }

  it 'for versions up to 0.49.0' do
    installed_rubocop(version: '0.39.0')

    expect(autocorrect_config.load).to eq('.rubocop_schema.yml')
  end

  it 'for versions 0.49.0 and above' do
    installed_rubocop(version: '0.49.0')

    expect(autocorrect_config.load).to eq('.rubocop_schema.49.yml')
  end

  it 'for versions 0.53.0 and above' do
    installed_rubocop(version: '0.53.0')

    expect(autocorrect_config.load).to eq('.rubocop_schema.53.yml')
  end

  def installed_rubocop(version:)
    allow(Gem).to receive_message_chain(:loaded_specs, :[], :version)
      .and_return(Gem::Version.new(version))
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fix-db-schema-conflicts-3.0.3 spec/unit/autocorrect_configuration_spec.rb