From de3fca228e8753ced2cd94570aba53e2800b09b8 Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Fri, 10 Apr 2015 06:12:08 +0000 Subject: [PATCH] Register a Layout with display information --- features/layout/registration.feature | 13 +++++++++++++ features/steps/filesystem_steps.rb | 3 +++ features/steps/output_steps.rb | 8 ++++++++ 3 files changed, 24 insertions(+) create mode 100644 features/layout/registration.feature create mode 100644 features/steps/filesystem_steps.rb diff --git a/features/layout/registration.feature b/features/layout/registration.feature new file mode 100644 index 0000000..5a71c60 --- /dev/null +++ b/features/layout/registration.feature @@ -0,0 +1,13 @@ +Feature: layout registration + + Scenario: sends the #register message to the layout with the display + Given a file named layout.rb with: + """ + class Layout + def register display + puts display + end + end + """ + When I run uhwm with option -r./layout -l Layout + Then the current output must contain current display diff --git a/features/steps/filesystem_steps.rb b/features/steps/filesystem_steps.rb new file mode 100644 index 0000000..a951c6f --- /dev/null +++ b/features/steps/filesystem_steps.rb @@ -0,0 +1,3 @@ +Given /^a file named ([^ ]+) with:$/ do |path, content| + write_file path, content +end diff --git a/features/steps/output_steps.rb b/features/steps/output_steps.rb index 6d23231..46fc2d0 100644 --- a/features/steps/output_steps.rb +++ b/features/steps/output_steps.rb @@ -31,3 +31,11 @@ end Then /^the current output must match \/([^\/]+)\/([a-z]*)$/ do |pattern, options| uhwm_wait_output Regexp.new(pattern, options) end + +Then /^the current output must contain:$/ do |content| + uhwm_wait_output content.to_s +end + +Then /^the current output must contain current display$/ do + uhwm_wait_output ENV['DISPLAY'] +end