Fix coding standards in UAT helpers

This commit is contained in:
Thibault Jouan 2015-04-21 06:07:47 +00:00
parent 3fd8658adf
commit ad67456c52

View File

@ -6,6 +6,7 @@ module Uh
module AcceptanceHelpers module AcceptanceHelpers
TIMEOUT_DEFAULT = 2 TIMEOUT_DEFAULT = 2
QUIT_KEYBINDING = 'alt+shift+q'.freeze QUIT_KEYBINDING = 'alt+shift+q'.freeze
LOG_CONNECTED = 'Connected to'.freeze
def uhwm_run options = '-v' def uhwm_run options = '-v'
command = %w[uhwm] command = %w[uhwm]
@ -45,7 +46,7 @@ module Uh
def uhwm_run_wait_ready options = nil def uhwm_run_wait_ready options = nil
if options then uhwm_run options else uhwm_run end if options then uhwm_run options else uhwm_run end
uhwm_wait_output 'Connected to' uhwm_wait_output LOG_CONNECTED
end end
def with_other_wm def with_other_wm
@ -69,11 +70,13 @@ module Uh
end end
def x_input_event_masks def x_input_event_masks
`xdpyinfo`[/current input event mask:\s+0x\h+([\w\s]+):/, 1].split(/\s+/).grep /Mask\z/ `xdpyinfo`[/current input event mask:\s+0x\h+([\w\s]+):/, 1]
.split(/\s+/)
.grep /Mask\z/
end end
def x_key key def x_key k
fail "cannot simulate X key `#{key}'" unless system "xdotool key #{key}" fail "cannot simulate X key `#{k}'" unless system "xdotool key #{k}"
end end
def x_socket_check pid def x_socket_check pid