Permalink
Browse files

Make sure that the value HighLine returns is a base String. Closes #16.

A change in HighLine 1.6.5 made it so that ask returned a HighLine::String by
default. HighLine::String overrides the reverse method on String, breaking the
fake Bcdatabase.encrypt used in the specs.
  • Loading branch information...
1 parent cd95cae commit 0647dcdfc777f7ff0a9d5a172174f6cd896be4db @rsutphin rsutphin committed Nov 6, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/bcdatabase/commands/epass.rb
@@ -24,7 +24,9 @@ def streamed
def interactive
loop do
- pass = @hl.ask("Password (^C to end): ") do |q|
+ # The proc ensures that HighLine doesn't coerce the answer to
+ # a HighLine::String.
+ pass = @hl.ask("Password (^C to end): ", proc { |a| a }) do |q|
# this is configurable because having it false hangs the
# unit tests.
q.echo = @echo

0 comments on commit 0647dcd

Please sign in to comment.