spec/integration/wrapper/credentials_input_wrapper in trollolo-0.1.1 vs spec/integration/wrapper/credentials_input_wrapper in trollolo-0.2.0

- old
+ new

@@ -1,19 +1,15 @@ #!/usr/bin/env ruby -require "expect" -require "pty" +require 'expect' +require 'pty' config_path = "/tmp/test-trollolorc-#{rand(100000)}" bin_path = File.expand_path('../../../../bin/trollolo', __FILE__) -ENV["TROLLOLO_CONFIG_PATH"] = config_path +ENV['TROLLOLO_CONFIG_PATH'] = config_path -PTY.spawn("#{bin_path} #{ARGV.join(" ")}") do |trollolo_out, trollolo_in, pid| - if !trollolo_out.expect("key:", 2) - exit 1 - end - trollolo_in.puts("xxx") - if !trollolo_out.expect("token:", 2) - exit 1 - end +PTY.spawn("#{bin_path} #{ARGV.join(' ')}") do |trollolo_out, trollolo_in, pid| + exit 1 unless trollolo_out.expect('key:', 2) + trollolo_in.puts('xxx') + exit 1 unless trollolo_out.expect('token:', 2) end