Skip to content

Commit

Permalink
file_signature: raise ArgumentError for bad checksum type instead of …
Browse files Browse the repository at this point in the history
…RuntimeError
  • Loading branch information
ndushay committed Sep 9, 2017
1 parent c2b9208 commit 913e3e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/moab/file_signature.rb
Expand Up @@ -79,7 +79,7 @@ def set_checksum(type,value)
when :sha256
@sha256 = value
else
raise "Unknown checksum type '#{type.to_s}'"
raise ArgumentError, "Unknown checksum type '#{type.to_s}'"
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/unit_tests/moab/file_signature_spec.rb
Expand Up @@ -44,7 +44,7 @@
)
end
it 'unknown checksum type' do
expect{file_sig.set_checksum('xyz', 'dummy')}.to raise_exception(/Unknown checksum type 'xyz'/)
expect{file_sig.set_checksum('xyz', 'dummy')}.to raise_exception(ArgumentError, /Unknown checksum type 'xyz'/)
end
end

Expand Down

0 comments on commit 913e3e9

Please sign in to comment.