From 42751993a248e8ab39c53f98bdfd97dd2615fa0a Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Tue, 21 Apr 2015 01:50:45 +0000 Subject: [PATCH] Test manager client unmanagement with cucumber --- features/manager/unmanage.feature | 7 +++++++ features/steps/x_steps.rb | 8 ++++++++ lib/uh/wm/testing/acceptance_helpers.rb | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 features/manager/unmanage.feature diff --git a/features/manager/unmanage.feature b/features/manager/unmanage.feature new file mode 100644 index 0000000..5851243 --- /dev/null +++ b/features/manager/unmanage.feature @@ -0,0 +1,7 @@ +Feature: manager client unmanagement + + Scenario: logs when a new client is unmanaged + Given uhwm is running + And a window is mapped + When the window requests to be unmapped + Then the output must match /unmanag.+xclient/i diff --git a/features/steps/x_steps.rb b/features/steps/x_steps.rb index d06e819..84629f9 100644 --- a/features/steps/x_steps.rb +++ b/features/steps/x_steps.rb @@ -1,3 +1,7 @@ +Given /^a window is mapped$/ do + x_window_map +end + Given /^a (\w+) window is mapped$/ do |ident| x_window_map ident: ident end @@ -10,6 +14,10 @@ When /^a window requests to be mapped$/ do x_window_map end +When /^the window requests to be unmapped$/ do + x_window_unmap +end + When /^the (\w+) window requests to be unmapped$/ do |ident| x_window_unmap ident: ident end diff --git a/lib/uh/wm/testing/acceptance_helpers.rb b/lib/uh/wm/testing/acceptance_helpers.rb index a1324b3..0c124cb 100644 --- a/lib/uh/wm/testing/acceptance_helpers.rb +++ b/lib/uh/wm/testing/acceptance_helpers.rb @@ -99,7 +99,7 @@ module Uh `xwininfo -id #{x_window_id options}`[/Map State: (\w+)/, 1] end - def x_window_unmap options + def x_window_unmap **options x_client(options).unmap x_client(options).sync end