diff options
author | glass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-22 10:56:49 +0000 |
---|---|---|
committer | glass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-22 10:56:49 +0000 |
commit | b906f78855989a5907d49d317e8e586b41818eaa (patch) | |
tree | 365365ae091eb352d5271ce084862ae3d473b67a /test/shell | |
parent | eb3ca699351c56ca736641ba12b69a2e63e4b628 (diff) | |
download | ruby-b906f78855989a5907d49d317e8e586b41818eaa.tar.gz |
Fix exception type in option type checker
* lib/shell/system-command.rb (SystemCommand#initialize):
`def_e2message` wraps error message, but does not define new exception
* test/shell/test_command_processor.rb: add a test
This patch is authored by Kenichi Kamiya <kachick1@gmail.com>
close #1657
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/shell')
-rw-r--r-- | test/shell/test_command_processor.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/shell/test_command_processor.rb b/test/shell/test_command_processor.rb index 99fe1b222a..9abc75d5e6 100644 --- a/test/shell/test_command_processor.rb +++ b/test/shell/test_command_processor.rb @@ -66,4 +66,17 @@ class TestShell::CommandProcessor < Test::Unit::TestCase Process.waitall Dir.rmdir(path) end + + def test_option_type + name = 'foo' + path = File.join(@tmpdir, name) + + open(path, 'w', 0755) {} + assert_raise(TypeError) { + catch(catch_command_start) {@shell.system(name, 42)} + } + ensure + Process.waitall + File.unlink(path) + end end |