system_check_spec.rb 645 Bytes
Newer Older
1
require 'spec_helper'
2
require 'rake_helper'
3

4
describe SystemCheck do
5 6 7 8 9 10 11 12 13 14 15
  class SimpleCheck < SystemCheck::BaseCheck
    def check?
      true
    end
  end

  class OtherCheck < SystemCheck::BaseCheck
    def check?
      false
    end
  end
16

17 18 19 20
  before do
    silence_output
  end

21
  describe '.run' do
22
    subject { described_class }
23

24 25
    it 'detects execution of SimpleCheck' do
      is_expected.to execute_check(SimpleCheck)
26

27 28
      subject.run('Test', [SimpleCheck])
    end
29

30 31
    it 'detects exclusion of OtherCheck in execution' do
      is_expected.not_to execute_check(OtherCheck)
32

33
      subject.run('Test', [SimpleCheck])
34 35 36
    end
  end
end