diff --git a/features/steps/run_steps.rb b/features/steps/run_steps.rb index 15203af..56d5fba 100644 --- a/features/steps/run_steps.rb +++ b/features/steps/run_steps.rb @@ -24,11 +24,11 @@ When /^I run uhwm with options? (-.+)$/ do |options| end When /^I tell uhwm to quit$/ do - x_key 'alt+shift+q' + uhwm_request_quit end When /^I quit uhwm$/ do - x_key 'alt+shift+q' + uhwm_request_quit assert_exit_status 0 end diff --git a/lib/uh/wm/testing/acceptance_helpers.rb b/lib/uh/wm/testing/acceptance_helpers.rb index d8256f1..984dbd5 100644 --- a/lib/uh/wm/testing/acceptance_helpers.rb +++ b/lib/uh/wm/testing/acceptance_helpers.rb @@ -5,6 +5,7 @@ module Uh module Testing module AcceptanceHelpers TIMEOUT_DEFAULT = 2 + QUIT_KEYBINDING = 'alt+shift+q'.freeze def uhwm_run options = '-v' command = %w[uhwm] @@ -12,6 +13,10 @@ module Uh @interactive = @process = run command.join ' ' end + def uhwm_request_quit + x_key QUIT_KEYBINDING + end + def uhwm_ensure_stop if @process x_key 'alt+shift+q'