summaryrefslogtreecommitdiff
path: root/spec/lib/system_check_spec.rb
diff options
context:
space:
mode:
authorGabriel Mazetto <brodock@gmail.com>2017-05-31 20:45:00 +0200
committerGabriel Mazetto <brodock@gmail.com>2017-05-31 20:45:00 +0200
commit0d4d9a6a63b2ac60ffeeeaef389295919c3119f4 (patch)
treee16ced93cbb4c2f41baee6b4900c4810f47cf2ad /spec/lib/system_check_spec.rb
parentd219f9a691973708f70d9517765a2ec926d6d903 (diff)
downloadgitlab-ce-0d4d9a6a63b2ac60ffeeeaef389295919c3119f4.tar.gz
Refactor and move things around to improve in YAGNI perspective
Diffstat (limited to 'spec/lib/system_check_spec.rb')
-rw-r--r--spec/lib/system_check_spec.rb42
1 files changed, 19 insertions, 23 deletions
diff --git a/spec/lib/system_check_spec.rb b/spec/lib/system_check_spec.rb
index 01679282f87..23d9beddb08 100644
--- a/spec/lib/system_check_spec.rb
+++ b/spec/lib/system_check_spec.rb
@@ -2,39 +2,35 @@ require 'spec_helper'
require 'rake_helper'
describe SystemCheck, lib: true do
- subject { SystemCheck }
+ class SimpleCheck < SystemCheck::BaseCheck
+ def check?
+ true
+ end
+ end
+
+ class OtherCheck < SystemCheck::BaseCheck
+ def check?
+ false
+ end
+ end
before do
silence_output
end
describe '.run' do
- context 'custom matcher' do
- class SimpleCheck < SystemCheck::BaseCheck
- def check?
- true
- end
- end
-
- class OtherCheck < SystemCheck::BaseCheck
- def check?
- false
- end
- end
+ subject { SystemCheck }
- subject { SystemCheck }
+ it 'detects execution of SimpleCheck' do
+ is_expected.to execute_check(SimpleCheck)
- it 'detects execution of SimpleCheck' do
- is_expected.to execute_check(SimpleCheck)
-
- SystemCheck.run('Test', [SimpleCheck])
- end
+ subject.run('Test', [SimpleCheck])
+ end
- it 'detects exclusion of OtherCheck in execution' do
- is_expected.not_to execute_check(OtherCheck)
+ it 'detects exclusion of OtherCheck in execution' do
+ is_expected.not_to execute_check(OtherCheck)
- SystemCheck.run('Test', [SimpleCheck])
- end
+ subject.run('Test', [SimpleCheck])
end
end
end