From d124dcf4eb245ced006ff4a3817322d8ecdbaea9 Mon Sep 17 00:00:00 2001 From: mame Date: Fri, 9 Apr 2010 15:04:54 +0000 Subject: * ext/pty/lib/expect.rb: raise an error when argument is unexpected type. based on a patch from Luiz Angelo Daros de Luca in [ruby-core:23464]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/pty/lib/expect.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ext/pty') diff --git a/ext/pty/lib/expect.rb b/ext/pty/lib/expect.rb index 50d2fbd363..52396d90bd 100644 --- a/ext/pty/lib/expect.rb +++ b/ext/pty/lib/expect.rb @@ -14,6 +14,8 @@ class IO e_pat = Regexp.new(Regexp.quote(pat)) when Regexp e_pat = pat + else + raise TypeError, "unsupported pattern class: #{pattern.class}" end while true if !IO.select([self],nil,nil,timeout) or eof? then -- cgit v1.2.3