JEG2/highline — Issue #29: Regression in answer_type conversion
Author: jsman
Created: 2012-01-08 17:10:52+00:00
State: open

I believe that commit f853f4a534374ddb4df9f828fa63d3ef2d167d75 broke the following test case that worked in release 1.6.2 and is broken in 1.6.5 and later.

```ruby
def test_ask_string
name = "James Edward Gray II"
@input << name << "\n"
@input.rewind

assert_equal(name, @terminal.ask("What is your name? ", String))

assert_raise(EOFError) { @terminal.ask("Any input left? ", String) }
end
```

The error that I am getting is

```
NoMethodError: undefined method `parse' for String:Class
/home/jsman/code/highline/lib/highline/question.rb:329:in `convert'
/home/jsman/code/highline/lib/highline.rb:268:in `ask'
/home/jsman/code/highline/test/tc_highline.rb:70:in `test_ask_string'
```