Refactor cucumber steps (quitting uhwm)
This commit is contained in:
parent
0b7c3e9128
commit
a4b6127ec8
@ -24,11 +24,11 @@ When /^I run uhwm with options? (-.+)$/ do |options|
|
|||||||
end
|
end
|
||||||
|
|
||||||
When /^I tell uhwm to quit$/ do
|
When /^I tell uhwm to quit$/ do
|
||||||
x_key 'alt+shift+q'
|
uhwm_request_quit
|
||||||
end
|
end
|
||||||
|
|
||||||
When /^I quit uhwm$/ do
|
When /^I quit uhwm$/ do
|
||||||
x_key 'alt+shift+q'
|
uhwm_request_quit
|
||||||
assert_exit_status 0
|
assert_exit_status 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ module Uh
|
|||||||
module Testing
|
module Testing
|
||||||
module AcceptanceHelpers
|
module AcceptanceHelpers
|
||||||
TIMEOUT_DEFAULT = 2
|
TIMEOUT_DEFAULT = 2
|
||||||
|
QUIT_KEYBINDING = 'alt+shift+q'.freeze
|
||||||
|
|
||||||
def uhwm_run options = '-v'
|
def uhwm_run options = '-v'
|
||||||
command = %w[uhwm]
|
command = %w[uhwm]
|
||||||
@ -12,6 +13,10 @@ module Uh
|
|||||||
@interactive = @process = run command.join ' '
|
@interactive = @process = run command.join ' '
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def uhwm_request_quit
|
||||||
|
x_key QUIT_KEYBINDING
|
||||||
|
end
|
||||||
|
|
||||||
def uhwm_ensure_stop
|
def uhwm_ensure_stop
|
||||||
if @process
|
if @process
|
||||||
x_key 'alt+shift+q'
|
x_key 'alt+shift+q'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user