Be more informative when the signature has an invalid type
This commit is contained in:
parent
1ff9611051
commit
04574cc836
@ -11,6 +11,6 @@ module Nostr
|
|||||||
# @example
|
# @example
|
||||||
# InvalidSignatureTypeError.new
|
# InvalidSignatureTypeError.new
|
||||||
#
|
#
|
||||||
def initialize = super('Invalid signature type')
|
def initialize = super('Invalid signature type. It must be a string with lowercase hexadecimal characters.')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -7,7 +7,7 @@ RSpec.describe Nostr::InvalidSignatureTypeError do
|
|||||||
let(:error) { described_class.new }
|
let(:error) { described_class.new }
|
||||||
|
|
||||||
it 'builds a useful error message' do
|
it 'builds a useful error message' do
|
||||||
expect(error.message).to eq('Invalid signature type')
|
expect(error.message).to eq('Invalid signature type. It must be a string with lowercase hexadecimal characters.')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -15,7 +15,7 @@ RSpec.describe Nostr::Signature do
|
|||||||
it 'raises an InvalidSignatureTypeError' do
|
it 'raises an InvalidSignatureTypeError' do
|
||||||
expect { described_class.new(1234) }.to raise_error(
|
expect { described_class.new(1234) }.to raise_error(
|
||||||
Nostr::InvalidSignatureTypeError,
|
Nostr::InvalidSignatureTypeError,
|
||||||
'Invalid signature type'
|
'Invalid signature type. It must be a string with lowercase hexadecimal characters.'
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user