Browse Source

Tests for states in case of no check at all

new-scoring
aeris 6 years ago
parent
commit
e1079d05f4
  1. 10
      spec/cryptcheck/state_spec.rb

10
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

Loading…
Cancel
Save