Sha256: 8e2e09ee9479f92c3440c3b4597ec25782fc96386b8af1545d0f75783de3bcab

Contents?: true

Size: 723 Bytes

Versions: 2

Compression:

Stored size: 723 Bytes

Contents

require 'lol_dba/cli'

RSpec.describe LolDba::CLI do
  subject do
    described_class.new('spec/fixtures', {})
  end

  describe '#start' do
    context 'with missing indexes' do
      before do
        allow(LolDba::IndexFinder).to receive(:run).and_return(true)
      end

      it 'returns false' do
        expect_any_instance_of(Kernel).to receive(:exit).with(1)
        subject.start('db:find_indexes')
      end
    end

    context 'without missing indexes' do
      before do
        allow(LolDba::IndexFinder).to receive(:run).and_return(false)
      end

      it 'returns true' do
        expect_any_instance_of(Kernel).not_to receive(:exit)
        subject.start('db:find_indexes')
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lol_dba-2.4.0 spec/cli_spec.rb
lol_dba-2.2.0 spec/cli_spec.rb