diff --git a/lib/aruba/api/commands.rb b/lib/aruba/api/commands.rb index 7997cf75a..b2a5fadc0 100644 --- a/lib/aruba/api/commands.rb +++ b/lib/aruba/api/commands.rb @@ -210,7 +210,7 @@ def run_command_and_stop(cmd, opts = {}) def type(input) return close_input if input == "\u0004" - last_command_started.write(input << "\n") + last_command_started.write("#{input}\n") end # Close stdin diff --git a/spec/aruba/api/commands_spec.rb b/spec/aruba/api/commands_spec.rb index 9a9f64fc7..06c9f7776 100644 --- a/spec/aruba/api/commands_spec.rb +++ b/spec/aruba/api/commands_spec.rb @@ -17,6 +17,12 @@ expect(@aruba.last_command_started).to have_output "Hello" end + it "respond to frozen input" do + @aruba.type "Hello".freeze + @aruba.type "\u0004".freeze + expect(@aruba.last_command_started).to have_output "Hello" + end + it "respond to close_input" do @aruba.type "Hello" @aruba.close_input