From 75cd101739a62fda9bd49c4d3b4dbf8927d7e27c Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Wed, 15 Apr 2015 01:17:35 +0000 Subject: [PATCH] Refactor cucumber scenarios --- features/run_control/key.feature | 9 +++------ features/steps/run_steps.rb | 5 +++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/features/run_control/key.feature b/features/run_control/key.feature index 5731935..ec6408e 100644 --- a/features/run_control/key.feature +++ b/features/run_control/key.feature @@ -1,28 +1,25 @@ Feature: `key' run control keyword Scenario: defines code to run when given key is pressed - Given a run control file with: + Given uhwm is running with this run control file: """ key(:f) { puts 'trigger f key code' } """ - And uhwm is running When I press the alt+f keys Then the output must contain "trigger f key code" Scenario: translates common key names to their X equivalent - Given a run control file with: + Given uhwm is running with this run control file: """ key(:enter) { puts 'trigger return key code' } """ - And uhwm is running When I press the alt+Return keys Then the output must contain "trigger return key code" Scenario: translates upcased key names to combination with shift key - Given a run control file with: + Given uhwm is running with this run control file: """ key(:F) { puts 'trigger shift+f key code' } """ - And uhwm is running When I press the alt+shift+f keys Then the output must contain "trigger shift+f key code" diff --git a/features/steps/run_steps.rb b/features/steps/run_steps.rb index 3470126..5e25604 100644 --- a/features/steps/run_steps.rb +++ b/features/steps/run_steps.rb @@ -6,6 +6,11 @@ Given /^uhwm is running$/ do uhwm_run_wait_ready end +Given /^uhwm is running with this run control file:$/ do |rc| + write_file '.uhwmrc.rb', rc + uhwm_run_wait_ready +end + When /^I start uhwm$/ do uhwm_run end