2017-02-13 06:21:12 -05:00
|
|
|
require 'spec_helper'
|
2017-05-25 19:46:54 -04:00
|
|
|
require 'rake_helper'
|
2017-02-13 06:21:12 -05:00
|
|
|
|
2017-07-10 10:24:02 -04:00
|
|
|
describe SystemCheck do
|
2017-05-31 14:45:00 -04:00
|
|
|
class SimpleCheck < SystemCheck::BaseCheck
|
|
|
|
def check?
|
|
|
|
true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class OtherCheck < SystemCheck::BaseCheck
|
|
|
|
def check?
|
|
|
|
false
|
|
|
|
end
|
|
|
|
end
|
2017-02-13 06:21:12 -05:00
|
|
|
|
2017-05-25 19:46:54 -04:00
|
|
|
before do
|
|
|
|
silence_output
|
|
|
|
end
|
|
|
|
|
2017-02-13 06:21:12 -05:00
|
|
|
describe '.run' do
|
2017-07-25 13:09:00 -04:00
|
|
|
subject { described_class }
|
2017-02-13 06:21:12 -05:00
|
|
|
|
2017-05-31 14:45:00 -04:00
|
|
|
it 'detects execution of SimpleCheck' do
|
|
|
|
is_expected.to execute_check(SimpleCheck)
|
2017-02-13 06:21:12 -05:00
|
|
|
|
2017-05-31 14:45:00 -04:00
|
|
|
subject.run('Test', [SimpleCheck])
|
|
|
|
end
|
2017-02-13 06:21:12 -05:00
|
|
|
|
2017-05-31 14:45:00 -04:00
|
|
|
it 'detects exclusion of OtherCheck in execution' do
|
|
|
|
is_expected.not_to execute_check(OtherCheck)
|
2017-02-13 06:21:12 -05:00
|
|
|
|
2017-05-31 14:45:00 -04:00
|
|
|
subject.run('Test', [SimpleCheck])
|
2017-02-13 06:21:12 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|