From f41b0abcef01d1c18edfcd4896a326a0a19c387e Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Tue, 25 Jun 2013 11:11:50 +0100 Subject: [PATCH] [cucumber tests] make the 'print version' tests less brittle --- features/step_definitions/thin_steps.rb | 4 ++++ features/thin_check.feature | 12 ++---------- features/thin_rmap.feature | 12 ++---------- 3 files changed, 8 insertions(+), 20 deletions(-) diff --git a/features/step_definitions/thin_steps.rb b/features/step_definitions/thin_steps.rb index 27f5118..9aa7b64 100644 --- a/features/step_definitions/thin_steps.rb +++ b/features/step_definitions/thin_steps.rb @@ -33,3 +33,7 @@ Then /^it should give no output$/ do output = ps.stdout + ps.stderr output.should == "" end + +Then(/^it should pass with version$/) do + only_processes.last.stdout.chomp.should == tools_version +end diff --git a/features/thin_check.feature b/features/thin_check.feature index 573a379..3b896a1 100644 --- a/features/thin_check.feature +++ b/features/thin_check.feature @@ -1,19 +1,11 @@ Feature: thin_check Scenario: print version (-V flag) When I run `thin_check -V` - Then it should pass with: - - """ - 0.1.5 - """ + Then it should pass with version Scenario: print version (--version flag) When I run `thin_check --version` - Then it should pass with: - - """ - 0.1.5 - """ + Then it should pass with version Scenario: print help When I run `thin_check --help` diff --git a/features/thin_rmap.feature b/features/thin_rmap.feature index 8f98631..97a3073 100644 --- a/features/thin_rmap.feature +++ b/features/thin_rmap.feature @@ -1,19 +1,11 @@ Feature: thin_rmap Scenario: print version (-V flag) When I run `thin_rmap -V` - Then it should pass with: - - """ - 0.1.5 - """ + Then it should pass with version Scenario: print version (--version flag) When I run `thin_rmap --version` - Then it should pass with: - - """ - 0.1.5 - """ + Then it should pass with version Scenario: print help When I run `thin_rmap --help`