From e1079d05f4ad01fbf220a4749d8ffecf3a99763c Mon Sep 17 00:00:00 2001 From: aeris Date: Sat, 15 Apr 2017 16:24:46 +0200 Subject: [PATCH] Tests for states in case of no check at all --- spec/cryptcheck/state_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/cryptcheck/state_spec.rb b/spec/cryptcheck/state_spec.rb index 66478aa..cffe43e 100644 --- a/spec/cryptcheck/state_spec.rb +++ b/spec/cryptcheck/state_spec.rb @@ -357,6 +357,11 @@ module CryptCheck end describe '::state' do + it 'must return false on bad case with nothing' do + states = { critical: {} } + expect(State.state states, :critical).to be_falsey + end + it 'must return false on bad case with only nil' do states = { critical: { foo: nil } } expect(State.state states, :critical).to be_falsey @@ -372,6 +377,11 @@ module CryptCheck expect(State.state states, :critical).to be_truthy end + it 'must return :all on good case with nothing' do + states = { best: {} } + expect(State.state states, :best).to eq :all + end + it 'must return :all on good case with only nil' do states = { best: { foo: nil } } expect(State.state states, :best).to eq :all