Sha256: 048dbd16799c41a27f42fa7e5a46975116ef229b26da9bfdaa95b08f7f811cc6
Contents?: true
Size: 1.98 KB
Versions: 4
Compression:
Stored size: 1.98 KB
Contents
module LightServiceExt RSpec.describe Configuration do let(:error_class) { ArgumentError } let(:default_error_class) { EncodingError } subject(:config) { described_class.new } describe '#new' do context 'with non fatal error classes' do before do config.non_fatal_error_classes = [error_class] end describe '#non_fatal_error_classes' do it 'returns set fatal error classes' do expect(config.non_fatal_error_classes).to match_array([error_class]) end end end context 'with default non fatal errors' do before do described_class.configure do |config| config.default_non_fatal_error_classes = [default_error_class] end end describe '#default_non_fatal_error_classes' do it 'returns set non fatal error classes' do expect(config.default_non_fatal_error_classes).to match_array([default_error_class]) end end end context 'with default and non default non fatal errors' do before do described_class.configure do |config| config.non_fatal_error_classes = [error_class, default_error_class, nil] config.default_non_fatal_error_classes = [default_error_class] end end describe '#non_fatal_errors' do it 'returns non duplicate error classes' do expect(config.non_fatal_errors).to match_array([error_class, default_error_class].map(&:to_s)) end end end describe '#allow_raise_on_failure' do it 'returns false' do expect(config.allow_raise_on_failure?).to be_truthy end context 'with allow raise on failure unset' do it 'returns true' do described_class.configure { |config| config.allow_raise_on_failure = false } expect(config.allow_raise_on_failure?).to be_falsey end end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems