debian-mirror-gitlab/spec/lib/system_check_spec.rb

39 lines
773 B
Ruby
Raw Normal View History

2019-12-04 20:38:33 +05:30
# frozen_string_literal: true
2017-09-10 17:25:29 +05:30
require 'spec_helper'
2021-09-04 01:27:46 +05:30
RSpec.describe SystemCheck, :silence_stdout do
2020-05-24 23:13:21 +05:30
before do
stub_const('SimpleCheck', Class.new(SystemCheck::BaseCheck))
stub_const('OtherCheck', Class.new(SystemCheck::BaseCheck))
SimpleCheck.class_eval do
def check?
true
end
2017-09-10 17:25:29 +05:30
end
2020-05-24 23:13:21 +05:30
OtherCheck.class_eval do
def check?
false
end
2017-09-10 17:25:29 +05:30
end
end
describe '.run' do
subject { described_class }
it 'detects execution of SimpleCheck' do
is_expected.to execute_check(SimpleCheck)
subject.run('Test', [SimpleCheck])
end
it 'detects exclusion of OtherCheck in execution' do
is_expected.not_to execute_check(OtherCheck)
subject.run('Test', [SimpleCheck])
end
end
end