diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index e94bbb5e2..8e50c01db 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -96,8 +96,12 @@ 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 + run: bundle exec rake cucumber checks: diff --git a/features/01_getting_started_with_aruba/run_commands.feature b/features/01_getting_started_with_aruba/run_commands.feature index 37ab92e41..96c3eb958 100644 --- a/features/01_getting_started_with_aruba/run_commands.feature +++ b/features/01_getting_started_with_aruba/run_commands.feature @@ -48,7 +48,46 @@ Feature: Run commands with Aruba When I successfully run `cucumber` Then the features should all pass - @requires-ruby + + @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: """ruby diff --git a/features/step_definitions/hooks.rb b/features/step_definitions/hooks.rb index 1ca22adc6..8fdad1700 100644 --- a/features/step_definitions/hooks.rb +++ b/features/step_definitions/hooks.rb @@ -63,3 +63,23 @@ Before "@unsupported-on-platform-mac" do skip_this_scenario if Cucumber::OS_X end + +Before('@requires-bash') do |scenario| + next if Aruba.platform.which('bash') + + if Cucumber::VERSION < '2' + scenario.skip_invoke! + else + 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