summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/drb/drbtest.rb51
1 files changed, 23 insertions, 28 deletions
diff --git a/test/drb/drbtest.rb b/test/drb/drbtest.rb
index aac705c..b2576d8 100644
--- a/test/drb/drbtest.rb
+++ b/test/drb/drbtest.rb
@@ -197,38 +197,33 @@ module DRbCore
end
end
- def test_07_public_private_protected_missing
- assert_nothing_raised() {
- begin
- @there.method_missing(:eval, 'nil')
- rescue NoMethodError
- assert_match(/^private method \`eval\'/, $!.message)
- end
+ def test_07_private_missing
+ e = assert_raise(NoMethodError) {
+ @there.method_missing(:eval, 'nil')
}
- assert_nothing_raised() {
- begin
- @there.call_private_method
- rescue NoMethodError
- assert_equal(NoMethodError, $!.class)
- assert_match(/^private method \`call_private_method\'/, $!.message)
- end
+ assert_match(/^private method \`eval\'/, e.message)
+
+ e = assert_raise(NoMethodError) {
+ @there.call_private_method
}
- assert_nothing_raised() {
- begin
- @there.call_protected_method
- rescue NoMethodError
- assert_equal(NoMethodError, $!.class)
- assert_match(/^protected method \`call_protected_method\'/, $!.message)
- end
+ assert_match(/^private method \`call_private_method\'/, e.message)
+ end
+
+ def test_07_protected_missing
+ e = assert_raise(NoMethodError) {
+ @there.call_protected_method
}
- assert_nothing_raised() {
- begin
- @there.method_missing(:undefined_method_test)
- rescue NoMethodError
- assert_equal(NoMethodError, $!.class)
- assert_match(/^undefined method \`undefined_method_test\'/, $!.message)
- end
+ assert_match(/^protected method \`call_protected_method\'/, e.message)
+ end
+
+ def test_07_public_missing
+ e = assert_raise(NoMethodError) {
+ @there.method_missing(:undefined_method_test)
}
+ assert_match(/^undefined method \`undefined_method_test\'/, e.message)
+ end
+
+ def test_07_send_missing
assert_raise(DRb::DRbConnError) do
@there.method_missing(:__send__, :to_s)
end