Browse Source

A little more precision on result definition logic

master
Christian Aust 1 month ago
parent
commit
8a36ef1b7e
1 changed files with 22 additions and 0 deletions
  1. +22
    -0
      spec/sanity/result_spec.rb

+ 22
- 0
spec/sanity/result_spec.rb View File

@ -14,6 +14,28 @@ RSpec.describe Sanity::Result do
it{ is_expected.to respond_to(:failures) }
it{ is_expected.to respond_to(:time) }
describe '#success?' do
it 'returns true if not failure or error' do
expect(success).to be_success
expect(failure).not_to be_success
expect(error).not_to be_success
end
end
describe '#failure?' do
it 'returns true if failure msg is set' do
expect(failure.failure).not_to be_nil
expect(failure).to be_failure
end
end
describe '#error?' do
it 'returns true if error msg is set' do
expect(error.error).not_to be_nil
expect(error).to be_error
end
end
context 'incident counts' do
subject do
described_class.new('foo').tap do |r|

Loading…
Cancel
Save