Skip to content

Commit 1fc07d4

Browse files
committed
Merge pull request #498 from badboy/fix-exception-assertions
Check exception message explicitely
2 parents 784ea9e + cc634ea commit 1fc07d4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/commands_on_value_types_test.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,15 @@ def test_migrate
101101
redis_mock(:migrate => lambda { |*args| args }) do |redis|
102102
options = { :host => "127.0.0.1", :port => 1234 }
103103

104-
assert_raise(RuntimeError, /host not specified/) do
104+
ex = assert_raise(RuntimeError) do
105105
redis.migrate("foo", options.reject { |key, _| key == :host })
106106
end
107+
assert ex.message =~ /host not specified/
107108

108-
assert_raise(RuntimeError, /port not specified/) do
109+
ex = assert_raise(RuntimeError) do
109110
redis.migrate("foo", options.reject { |key, _| key == :port })
110111
end
112+
assert ex.message =~ /port not specified/
111113

112114
default_db = redis.client.db.to_i
113115
default_timeout = redis.client.timeout.to_i

0 commit comments

Comments
 (0)