Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/concurrent-ruby-edge/concurrent/channel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class Channel
class ValidationError < Error
def initialize(message = nil)
message ||= 'invalid value'
super(message)
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/concurrent/channel_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ module Concurrent
subject = Channel.new(capacity: 10, validator: validator)
expect{
subject.put!(42)
}.to raise_error(Channel::ValidationError)
}.to raise_error(Channel::ValidationError, 'invalid value')
end

it 'rejects when the validator raises an exception' do
Expand All @@ -176,7 +176,7 @@ module Concurrent
it 'rejects nil' do
expect {
subject.put!(nil)
}.to raise_error(Channel::ValidationError)
}.to raise_error(Channel::ValidationError, 'nil is not a valid value')
end
end

Expand Down
Loading