From 3fd8658adf0696e8f5302bdaa97445c98b3aabe1 Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Tue, 21 Apr 2015 06:01:23 +0000 Subject: [PATCH] Simplify cucumber steps (uhwm process) --- features/steps/x_steps.rb | 2 +- lib/uh/wm/testing/acceptance_helpers.rb | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/features/steps/x_steps.rb b/features/steps/x_steps.rb index f8cacf1..079873f 100644 --- a/features/steps/x_steps.rb +++ b/features/steps/x_steps.rb @@ -33,7 +33,7 @@ end Then /^it must connect to X display$/ do uhwm_wait_output 'Connected to' - expect(x_socket_check uhwm_pid).to be true + expect(x_socket_check uhwm.pid).to be true end Then /^the window must be mapped$/ do diff --git a/lib/uh/wm/testing/acceptance_helpers.rb b/lib/uh/wm/testing/acceptance_helpers.rb index 984dbd5..b84957f 100644 --- a/lib/uh/wm/testing/acceptance_helpers.rb +++ b/lib/uh/wm/testing/acceptance_helpers.rb @@ -13,6 +13,10 @@ module Uh @interactive = @process = run command.join ' ' end + def uhwm + @process + end + def uhwm_request_quit x_key QUIT_KEYBINDING end @@ -24,14 +28,6 @@ module Uh end end - def uhwm_pid - @process.pid - end - - def uhwm_output - @process.stdout - end - def uhwm_wait_output message output = -> { @process.stdout + @process.stderr } timeout_until do