spec/reporter.rb in health-reporter-0.1.1 vs spec/reporter.rb in health-reporter-0.2.0
- old
+ new
@@ -72,9 +72,18 @@
expect(subject.dependencies).to eq({
'https://hardware-store/status' => { :code => 123, :timeout => 1 },
'https://grocery-store/status' => { :code => 123, :timeout => 1 }
})
end
+
+ it 'clears the cache when requested' do
+ subject.healthy?
+ expect(subject.class_variable_get('@@healthy')).to be true
+ expect(subject.class_variable_get('@@last_check_time')).to_not be nil
+ subject.clear_cache
+ expect(subject.class_variable_get('@@healthy')).to be nil
+ expect(subject.class_variable_get('@@last_check_time')).to be nil
+ end
end
context 'when exercising self-test lambda' do
it 'allows true to be returned by self-test lambda' do
test_lambda = lambda{ true }