Sha256: 20fd65106ee3a2ac23c57a81faa6dec27372c8666966708d12273117586ad579
Contents?: true
Size: 842 Bytes
Versions: 15
Compression:
Stored size: 842 Bytes
Contents
require 'spec_helper' describe Notu::Error do let(:error) { Notu::Error.new('BAM!') } let(:original) { StandardError.new('BIM!') } describe '#message' do it 'is message set at initialization' do expect(error.message).to eq('BAM!') end it 'message is squished' do expect(Notu::Error.new(" hello \n world").message).to eq('hello world') end it 'default one if blank' do expect(Notu::Error.new(" ").message).to eq('Notu::Error') end end describe '#original' do it 'is nil by default' do expect(error.original).to be_nil end it 'is exception given at initialization' do expect(Notu::Error.new(original).original).to be(original) end it 'sets message from original' do expect(Notu::Error.new(original).message).to eq('BIM!') end end end
Version data entries
15 entries across 15 versions & 1 rubygems