From 87a03f6c1a2c78628e1e9d39c1b04c5d7a95e5de Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Fri, 30 Sep 2016 15:23:08 +0530 Subject: [PATCH] replace zero exit status steps --- features/step_definitions.rb | 23 ++++++++++++++++++++++- features/theme_gem.feature | 15 +++++++-------- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/features/step_definitions.rb b/features/step_definitions.rb index 7d490cda..bf6883af 100644 --- a/features/step_definitions.rb +++ b/features/step_definitions.rb @@ -166,7 +166,7 @@ end # When(%r!^I run git add .$!) do - run_in_shell("git", "add", ".") + run_in_shell("git", "add", ".", "--verbose") end # @@ -264,6 +264,27 @@ end # +Then(%r!^I should get an updated git index$!) do + index = %w( + .gitignore + Gemfile + LICENSE.txt + README.md + _includes/blank.html + _layouts/default.html + _layouts/page.html + _layouts/post.html + _sass/blank.scss + assets/css/blank.scss + my-cool-theme.gemspec + ) + index.each do |file| + expect(jekyll_run_output).to match file + end +end + +# + Then(%r!^I should get a zero exit(?:\-| )status$!) do step %(I should see "EXIT STATUS: 0" in the build output) end diff --git a/features/theme_gem.feature b/features/theme_gem.feature index d36c71ac..875a8568 100644 --- a/features/theme_gem.feature +++ b/features/theme_gem.feature @@ -10,18 +10,17 @@ Feature: Building Theme Gems Scenario: Checking if a bonafide Theme gem will be built from generated scaffolding When I run jekyll new-theme my-cool-theme - Then I should get a zero exit status - And the my-cool-theme directory should exist + Then the my-cool-theme directory should exist When I decide to build the theme gem - Then I should get a zero exit status + Then the "_includes/blank.html" file should exist + Then the "_sass/blank.scss" file should exist + Then the "assets/css/blank.scss" file should exist When I run git add . - Then I should get a zero exit status + Then I should get an updated git index When I run gem build my-cool-theme.gemspec - Then I should get a zero exit status - And the "./my-cool-theme-0.1.0.gem" file should exist + Then the "./my-cool-theme-0.1.0.gem" file should exist When I run gem unpack my-cool-theme-0.1.0.gem - Then I should get a zero exit status - And the my-cool-theme-0.1.0 directory should exist + Then the my-cool-theme-0.1.0 directory should exist And the "my-cool-theme-0.1.0/_layouts/default.html" file should exist And the "my-cool-theme-0.1.0/_includes/blank.html" file should exist And the "my-cool-theme-0.1.0/_sass/blank.scss" file should exist