From e75c65f7a7d6fcf042c3476099426eefeb4e48e8 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Mon, 5 Apr 2021 12:16:23 +0200 Subject: [PATCH 1/7] WIP: Cukes on Windows --- .github/workflows/ruby.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index e94bbb5e2..1820c47d4 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -98,6 +98,8 @@ jobs: bundler-cache: true - name: Run specs run: bundle exec rake spec + - name: Run cukes + run: bundle exec rake cucumber checks: From 1f2a04bb61d79413e5059cc42763c1a6f7ef7605 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Mon, 5 Apr 2021 12:49:44 +0200 Subject: [PATCH 2/7] Silence warnings about ansicon --- .github/workflows/ruby.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 1820c47d4..8e50c01db 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -96,6 +96,8 @@ jobs: with: ruby-version: ${{ matrix.ruby }} bundler-cache: true + - name: Install ansicon to silence colour warnings + run: cinst ansicon - name: Run specs run: bundle exec rake spec - name: Run cukes From d8bb6de13e3206a7c284ab97396f614c1a10b410 Mon Sep 17 00:00:00 2001 From: Andrew Walter Date: Sat, 19 May 2018 19:31:02 +1000 Subject: [PATCH 3/7] Skip scenarios tagged with `@requires-bash` unless bash is installed --- features/support/env.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/features/support/env.rb b/features/support/env.rb index b6294882c..c84c02dcf 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -31,3 +31,7 @@ # with parent process's coverage data. ENV["RUBYOPT"] = "-r#{simplecov_setup_pathname} #{ENV['RUBYOPT']}" end + +Before('@requires-bash') do |scenario| + skip_this_scenario unless Aruba.platform.which('bash') +end \ No newline at end of file From c1933d05753e5511f00d4f067e980204cccd9388 Mon Sep 17 00:00:00 2001 From: Andrew Walter Date: Sat, 19 May 2018 21:17:39 +1000 Subject: [PATCH 4/7] Moved `@requires-bash` before hook to hooks.rb --- features/step_definitions/hooks.rb | 4 ++++ features/support/env.rb | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/features/step_definitions/hooks.rb b/features/step_definitions/hooks.rb index 1ca22adc6..139460690 100644 --- a/features/step_definitions/hooks.rb +++ b/features/step_definitions/hooks.rb @@ -63,3 +63,7 @@ Before "@unsupported-on-platform-mac" do skip_this_scenario if Cucumber::OS_X end + +Before('@requires-bash') do |scenario| + skip_this_scenario unless Aruba.platform.which('bash') +end diff --git a/features/support/env.rb b/features/support/env.rb index c84c02dcf..b6294882c 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -31,7 +31,3 @@ # with parent process's coverage data. ENV["RUBYOPT"] = "-r#{simplecov_setup_pathname} #{ENV['RUBYOPT']}" end - -Before('@requires-bash') do |scenario| - skip_this_scenario unless Aruba.platform.which('bash') -end \ No newline at end of file From 3eea0f9e7c2511d17112a486f9aeff37dbdf0f2c Mon Sep 17 00:00:00 2001 From: Andrew Walter Date: Sat, 19 May 2018 21:23:02 +1000 Subject: [PATCH 5/7] Updated `@requires-bash` before hook. --- features/step_definitions/hooks.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/features/step_definitions/hooks.rb b/features/step_definitions/hooks.rb index 139460690..da14060c1 100644 --- a/features/step_definitions/hooks.rb +++ b/features/step_definitions/hooks.rb @@ -65,5 +65,11 @@ end Before('@requires-bash') do |scenario| - skip_this_scenario unless Aruba.platform.which('bash') + next if Aruba.platform.which('bash') + + if Cucumber::VERSION < '2' + scenario.skip_invoke! + else + skip_this_scenario + end end From c42ea862987b71ea64a939dc45add6e93151e289 Mon Sep 17 00:00:00 2001 From: Andrew Walter Date: Sat, 19 May 2018 21:50:45 +1000 Subject: [PATCH 6/7] Fixed `run_commands` feature on Windows --- features/01_getting_started_with_aruba/run_commands.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/01_getting_started_with_aruba/run_commands.feature b/features/01_getting_started_with_aruba/run_commands.feature index 37ab92e41..7de6b5ad3 100644 --- a/features/01_getting_started_with_aruba/run_commands.feature +++ b/features/01_getting_started_with_aruba/run_commands.feature @@ -48,7 +48,7 @@ Feature: Run commands with Aruba When I successfully run `cucumber` Then the features should all pass - @requires-ruby + @requires-ruby @unsupported-on-platform-windows Scenario: Ruby Program Given an executable named "bin/aruba-test-cli" with: """ruby From bc5818ef26ba1f6b5b1341f567ed33dd06cba5af Mon Sep 17 00:00:00 2001 From: Andrew Walter Date: Sat, 19 May 2018 22:09:00 +1000 Subject: [PATCH 7/7] Feature - Run_commands: Added Batch program scenarios --- .../run_commands.feature | 39 +++++++++++++++++++ features/step_definitions/hooks.rb | 10 +++++ 2 files changed, 49 insertions(+) diff --git a/features/01_getting_started_with_aruba/run_commands.feature b/features/01_getting_started_with_aruba/run_commands.feature index 7de6b5ad3..96c3eb958 100644 --- a/features/01_getting_started_with_aruba/run_commands.feature +++ b/features/01_getting_started_with_aruba/run_commands.feature @@ -48,6 +48,45 @@ Feature: Run commands with Aruba When I successfully run `cucumber` Then the features should all pass + + @requires-cmd + Scenario: Batch Program + Given an executable named "bin/aruba-test-cli.bat" with: + """bash + echo "Hello, Aruba!" + """ + And a file named "features/hello_aruba.feature" with: + """ + Feature: Getting Started With Aruba + Scenario: First Run of Command + Given I successfully run `aruba-test-cli` + Then the output should contain: + \"\"\" + Hello, Aruba! + \"\"\" + """ + When I successfully run `cucumber` + Then the features should all pass + + @requires-cmd + Scenario: Batch Program run via cmd + Given a file named "features/hello_aruba.feature" with: + """ + Feature: Getting Started With Aruba + Scenario: First Run of Command + Given a file named "cli.bat" with: + \"\"\" + echo "Hello, Aruba!" + \"\"\" + When I successfully run `cmd.exe /c cli.bat` + Then the output should contain: + \"\"\" + Hello, Aruba! + \"\"\" + """ + When I successfully run `cucumber` + Then the features should all pass + @requires-ruby @unsupported-on-platform-windows Scenario: Ruby Program Given an executable named "bin/aruba-test-cli" with: diff --git a/features/step_definitions/hooks.rb b/features/step_definitions/hooks.rb index da14060c1..8fdad1700 100644 --- a/features/step_definitions/hooks.rb +++ b/features/step_definitions/hooks.rb @@ -73,3 +73,13 @@ skip_this_scenario end end + +Before('@requires-cmd') do |scenario| + next if Aruba.platform.which('cmd') + + if Cucumber::VERSION < '2' + scenario.skip_invoke! + else + skip_this_scenario + end +end \ No newline at end of file