From 947df56d6badfc860e68d0bd0933152822c4b654 Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Wed, 23 Apr 2014 22:44:35 +0000 Subject: [PATCH] Expose fake home dir usage with a cucumber tag --- features/ssh/config.feature | 1 + features/steps/ssh_steps.rb | 3 --- features/support/env_fake_home.rb | 3 +++ 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 features/support/env_fake_home.rb diff --git a/features/ssh/config.feature b/features/ssh/config.feature index 2d0d5d7..717793d 100644 --- a/features/ssh/config.feature +++ b/features/ssh/config.feature @@ -12,6 +12,7 @@ Feature: SSH settings When I successfully execute the recipe Then the output must contain my current login name + @fake_home Scenario: uses configured SSH user name for a given host Given an SSH config with: """ diff --git a/features/steps/ssh_steps.rb b/features/steps/ssh_steps.rb index 174293d..0fca3d0 100644 --- a/features/steps/ssh_steps.rb +++ b/features/steps/ssh_steps.rb @@ -1,6 +1,3 @@ -# FIXME: current home directory shouldn't be changed here, maybe we should use -# a tag for features needing a fake home directory. Given /^an SSH config with:$/ do |config| - ENV['HOME'] = File.expand_path(current_dir) write_file '.ssh/config', config end diff --git a/features/support/env_fake_home.rb b/features/support/env_fake_home.rb new file mode 100644 index 0000000..ee81e4f --- /dev/null +++ b/features/support/env_fake_home.rb @@ -0,0 +1,3 @@ +Before('@fake_home') do + ENV['HOME'] = File.expand_path(current_dir) +end