diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7296b1f50..cf183290d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -84,6 +84,20 @@ jobs: bundler-cache: true - name: Run specs run: bundle exec rake spec + - name: Run cukes (1) + run: bundle exec cucumber features/01_getting_started_with_aruba/ + # - name: Run cukes (2) + # run: bundle exec cucumber features/02_configure_aruba/ + # - name: Run cukes (3) + # run: bundle exec cucumber features/03_testing_frameworks/ + # - name: Run cukes (4) + # run: bundle exec cucumber features/04_aruba_api/ + # - name: Run cukes (5) + # run: bundle exec cucumber features/05_use_rspec_matchers/ + # - name: Run cukes (6) + # run: bundle exec cucumber features/06_use_aruba_cli/ + # - name: Run cukes (8) + # run: bundle exec cucumber features/08_other/ checks: runs-on: ubuntu-latest diff --git a/features/01_getting_started_with_aruba/run_commands.feature b/features/01_getting_started_with_aruba/run_commands.feature index 37ab92e41..b2b264a02 100644 --- a/features/01_getting_started_with_aruba/run_commands.feature +++ b/features/01_getting_started_with_aruba/run_commands.feature @@ -8,7 +8,7 @@ Feature: Run commands with Aruba Background: Given I use a fixture named "getting-started-app" - @requires-bash + @requires-bash @unsupported-on-platform-windows Scenario: Bash Program Given an executable named "bin/aruba-test-cli" with: """bash @@ -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 @@ -87,3 +87,22 @@ Feature: Run commands with Aruba """ When I successfully run `cucumber` Then the features should all pass + + @requires-platform-windows + Scenario: Windows .bat script + Given an executable named "bin/aruba-test-cli.bat" with: + """ + echo "Hello, Aruba!" + """ + Given 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 diff --git a/features/01_getting_started_with_aruba/supported_testing_frameworks.feature b/features/01_getting_started_with_aruba/supported_testing_frameworks.feature index 54582ec7e..dda495ee2 100644 --- a/features/01_getting_started_with_aruba/supported_testing_frameworks.feature +++ b/features/01_getting_started_with_aruba/supported_testing_frameworks.feature @@ -65,7 +65,7 @@ Feature: Supported Testing Frameworks """ $LOAD_PATH.unshift File.expand_path('../test', __FILE__) - require 'test_helper' + require_relative 'test_helper' require 'minitest/autorun' class FirstRun < Minitest::Test diff --git a/features/step_definitions/hooks.rb b/features/step_definitions/hooks.rb index 181e6c28f..71a7f5746 100644 --- a/features/step_definitions/hooks.rb +++ b/features/step_definitions/hooks.rb @@ -26,6 +26,18 @@ skip_this_scenario end +Before '@requires-bash' do + next unless Aruba.platform.which('bash').nil? + + skip_this_scenario +end + +Before '@requires-platform-windows' do + next if Cucumber::WINDOWS + + skip_this_scenario +end + Before '@requires-posix-standard-tools' do next unless Aruba.platform.which('printf').nil? diff --git a/fixtures/cli-app/bin/aruba-test-cli.bat b/fixtures/cli-app/bin/aruba-test-cli.bat new file mode 100644 index 000000000..a66c9a78a --- /dev/null +++ b/fixtures/cli-app/bin/aruba-test-cli.bat @@ -0,0 +1,6 @@ +@ECHO OFF +IF NOT "%~f0" == "~f0" GOTO :WinNT +@"ruby.exe" "./aruba-test-cli" %1 %2 %3 %4 %5%6 %7 %8 %9 +GOTO :EOF +:WinNT +@"ruby.exe" "%~dpn0" %*