From accbebe97ce8e543037f2d9143fff40d27943aa1 Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Wed, 22 Apr 2015 08:08:21 +0000 Subject: [PATCH] Test how the manager handles window changes --- features/manager/change.feature | 7 +++++++ features/steps/x_steps.rb | 4 ++++ lib/uh/wm/testing/acceptance_helpers.rb | 5 +++++ 3 files changed, 16 insertions(+) create mode 100644 features/manager/change.feature diff --git a/features/manager/change.feature b/features/manager/change.feature new file mode 100644 index 0000000..0d44d10 --- /dev/null +++ b/features/manager/change.feature @@ -0,0 +1,7 @@ +Feature: clients window properties updating + + Scenario: logs when the window properties of a client change + Given uhwm is running + And a window is mapped + When the window name changes to "testing_new_name" + Then the output must match /updat.+testing_new_name/i diff --git a/features/steps/x_steps.rb b/features/steps/x_steps.rb index 13fe3a6..fcdc8a8 100644 --- a/features/steps/x_steps.rb +++ b/features/steps/x_steps.rb @@ -28,6 +28,10 @@ When /^the window is destroyed$/ do x_client.destroy.sync end +When /^the window name changes to "([^"]+)"$/ do |name| + x_client.window_name = name +end + Then /^it must connect to X display$/ do uhwm_wait_ready expect(x_socket_check uhwm.pid).to be true diff --git a/lib/uh/wm/testing/acceptance_helpers.rb b/lib/uh/wm/testing/acceptance_helpers.rb index ec7d153..7558ca0 100644 --- a/lib/uh/wm/testing/acceptance_helpers.rb +++ b/lib/uh/wm/testing/acceptance_helpers.rb @@ -159,6 +159,11 @@ module Uh @name end + def window_name= name + @name = @window.name = name + window.name + end + def map times: 1 times.times { window.map } window.map