From 09deb345cfe36f7b386afbd3655088ff51d9ae80 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Mon, 5 Apr 2021 12:16:23 +0200 Subject: [PATCH 01/25] Run cucumber scenarios 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 2643c2c55..cab4eee89 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -83,6 +83,8 @@ jobs: bundler-cache: true - name: Run specs run: bundle exec rake spec + - name: Run cukes + run: bundle exec rake cucumber checks: From 8609a39a40067e52ad5e27b3fac1cfb14eab1788 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Fri, 18 Jun 2021 15:07:08 +0200 Subject: [PATCH 02/25] Temporarily limit set of platforms --- .github/workflows/ruby.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index cab4eee89..7984efc01 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -23,11 +23,8 @@ jobs: strategy: matrix: - ruby: ["3.1", "3.2", "jruby-9.4", "3.3"] - appraisal: [cucumber_8, cucumber_9] - include: - - ruby: "3.0" - appraisal: cucumber_8 + ruby: ["3.2"] + appraisal: [cucumber_9] env: BUNDLE_GEMFILE: gemfiles/${{ matrix.appraisal }}.gemfile @@ -48,7 +45,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ["3.0", "3.1", "3.2", "3.3"] + ruby: ["3.2"] runs-on: macos-latest @@ -68,7 +65,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ["3.0", "3.1", "3.2", "3.3"] + ruby: ["3.2"] runs-on: windows-latest From 8546717787966981bc9a00a1a2dcb4d0015f06c9 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sun, 30 Jun 2019 20:30:16 +0200 Subject: [PATCH 03/25] Add bat runner for default test cli app --- fixtures/cli-app/bin/aruba-test-cli.bat | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 fixtures/cli-app/bin/aruba-test-cli.bat 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" %* From 8bb5d1136d6ecc12fdfab90d326a54fe4dabeb87 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sun, 30 Jun 2019 21:02:01 +0200 Subject: [PATCH 04/25] Use default executable instead of specifying another --- features/04_aruba_api/command/run_command.feature | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/features/04_aruba_api/command/run_command.feature b/features/04_aruba_api/command/run_command.feature index c7c655890..4ddda99de 100644 --- a/features/04_aruba_api/command/run_command.feature +++ b/features/04_aruba_api/command/run_command.feature @@ -24,12 +24,7 @@ Feature: Run command Given I use a fixture named "cli-app" Scenario: Executable in the project's path - Given an executable named "bin/aruba-test-cli" with: - """bash - #!/bin/bash - exit 0 - """ - And a file named "spec/run_spec.rb" with: + Given a file named "spec/run_spec.rb" with: """ruby require 'spec_helper' From 41434979082231f17b755ac9a69ca8c5b63ea0fe Mon Sep 17 00:00:00 2001 From: Andrew Walter Date: Sun, 10 Jun 2018 19:01:01 +1000 Subject: [PATCH 05/25] CI: Skip scenarios with `@requires-bash` unless bash is installed. --- features/step_definitions/hooks.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/features/step_definitions/hooks.rb b/features/step_definitions/hooks.rb index 1facf2c7a..4ac8e99aa 100644 --- a/features/step_definitions/hooks.rb +++ b/features/step_definitions/hooks.rb @@ -30,6 +30,12 @@ skip_this_scenario end +Before "@requires-bash" do + next unless Aruba.platform.which("bash").nil? + + skip_this_scenario +end + Before "@requires-posix-standard-tools" do next unless Aruba.platform.which("printf").nil? From b4dc9e1eac33712a2d3f806cd0e378a889585d1b Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Wed, 3 Jul 2019 15:48:07 +0200 Subject: [PATCH 06/25] Improve be_a_command_found_in_path matcher and its tests * Test all behavior in the specs * Leave simple scenario as documentation * Simplify implementation * Render correct path in failure message * Provide separate scenarios for Windows and Unix --- .../file/be_a_command_found_in_path.feature | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/features/05_use_rspec_matchers/file/be_a_command_found_in_path.feature b/features/05_use_rspec_matchers/file/be_a_command_found_in_path.feature index a5c3198e0..19d81209e 100644 --- a/features/05_use_rspec_matchers/file/be_a_command_found_in_path.feature +++ b/features/05_use_rspec_matchers/file/be_a_command_found_in_path.feature @@ -6,7 +6,8 @@ Feature: Check if command can be found in PATH Background: Given I use a fixture named "cli-app" - Scenario: Checking an existing executable file in PATH + @unsupported-on-platform-windows + Scenario: Checking an existing executable file in PATH on Unix Given a file named "spec/existing_executable_spec.rb" with: """ require 'spec_helper' @@ -25,3 +26,24 @@ Feature: Check if command can be found in PATH """ When I run `rspec` Then the specs should all pass + + @unsupported-on-platform-unix + Scenario: Checking an existing executable file in PATH on Windows + Given a file named "spec/existing_executable_spec.rb" with: + """ + require 'spec_helper' + + RSpec.describe 'Check if command can be found in PATH', type: :aruba do + let(:file) { 'foo.bat' } + + before do + touch(file) + chmod(0o755, file) + prepend_environment_variable('PATH', format('%s:', expand_path('.'))) + end + + it { expect(file).to be_a_command_found_in_path } + end + """ + When I run `rspec` + Then the specs should all pass From 7fed560453c7f748e4333f2a198698a511c12059 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Wed, 3 Jul 2019 16:33:56 +0200 Subject: [PATCH 07/25] Make check_timeouts feature cross-platform * Use existing commands instead of non-portable bash scripts * Use timeout command if sleep is not available --- .../command/check_timeouts.feature | 39 ++++++++----------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/features/05_use_rspec_matchers/command/check_timeouts.feature b/features/05_use_rspec_matchers/command/check_timeouts.feature index c02145ee2..c90cfdca3 100644 --- a/features/05_use_rspec_matchers/command/check_timeouts.feature +++ b/features/05_use_rspec_matchers/command/check_timeouts.feature @@ -1,47 +1,42 @@ Feature: Check if a timeout occured during command execution - If you want to check if a command takes to long to finish it's work + If you want to check if a command takes too long to finish its work, you can + use the `run_too_long` and `have_finished_in_time` matchers. Background: Given I use a fixture named "cli-app" - Scenario: Check if command runs to long - Given an executable named "bin/aruba-test-cli" with: - """ - #!/bin/bash - sleep 1 - """ - And a file named "spec/timeout_spec.rb" with: + Scenario: Check if command runs too long + Given a file named "spec/timeout_spec.rb" with: """ require 'spec_helper' - RSpec.describe 'Long running command', :type => :aruba do - before { aruba.config.exit_timeout = 0 } - - before { run_command('aruba-test-cli') } + RSpec.describe 'Long running command', type: :aruba do + before { aruba.config.exit_timeout = 0.1 } - it { expect(last_command_started).to run_too_long } + it "runs too long" do + slow_command = which('sleep') ? 'sleep 0.2' : 'timeout 2' + run_command slow_command + expect(last_command_started).to run_too_long + end end """ When I run `rspec` Then the specs should all pass Scenario: Check if command finishes in time - Given an executable named "bin/aruba-test-cli" with: - """ - #!/bin/bash - exit 0 - """ - And a file named "spec/timeout_spec.rb" with: + Given a file named "spec/timeout_spec.rb" with: """ require 'spec_helper' - RSpec.describe 'Short running command', :type => :aruba do + RSpec.describe 'Short running command', type: :aruba do before { aruba.config.exit_timeout = 5 } - before { run_command('aruba-test-cli') } + it "is done quickly" do + run_command('echo "Fast!"') - it { expect(last_command_started).to have_finished_in_time } + expect(last_command_started).to have_finished_in_time + end end """ When I run `rspec` From 13e4d96bae318708b6f863ab6373cffad399ab79 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Mon, 5 Apr 2021 12:49:44 +0200 Subject: [PATCH 08/25] 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 7984efc01..e95117024 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -78,6 +78,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 727b96c91c34d9f248704664494a678a429d140e Mon Sep 17 00:00:00 2001 From: Andrew Walter Date: Sun, 10 Jun 2018 18:22:14 +1000 Subject: [PATCH 09/25] Started adding unpublished windows-specific features. --- .../cleanup_working_directory.feature | 2 + features/unpublished/.cucumberproignore | 0 .../cleanup_working_directory.feature | 57 +++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 features/unpublished/.cucumberproignore create mode 100644 features/unpublished/windows/01_getting_started_with_aruba/cleanup_working_directory.feature diff --git a/features/01_getting_started_with_aruba/cleanup_working_directory.feature b/features/01_getting_started_with_aruba/cleanup_working_directory.feature index 237273721..5df02dc69 100644 --- a/features/01_getting_started_with_aruba/cleanup_working_directory.feature +++ b/features/01_getting_started_with_aruba/cleanup_working_directory.feature @@ -8,6 +8,7 @@ Feature: Cleanup Aruba Working Directory Background: Given I use a fixture named "cli-app" + @unsupported-on-platform-windows Scenario: Clean up artifacts and pwd from a previous scenario Given a file named "features/cleanup.feature" with: """ @@ -30,6 +31,7 @@ Feature: Cleanup Aruba Working Directory When I run `cucumber` Then the features should all pass + @unsupported-on-platform-windows Scenario: Do not clobber before run The `@no-clobber` tag stops Aruba from clearing out its scratch directory. Other setup steps are still performed, such as setting the current working diff --git a/features/unpublished/.cucumberproignore b/features/unpublished/.cucumberproignore new file mode 100644 index 000000000..e69de29bb diff --git a/features/unpublished/windows/01_getting_started_with_aruba/cleanup_working_directory.feature b/features/unpublished/windows/01_getting_started_with_aruba/cleanup_working_directory.feature new file mode 100644 index 000000000..aef650f48 --- /dev/null +++ b/features/unpublished/windows/01_getting_started_with_aruba/cleanup_working_directory.feature @@ -0,0 +1,57 @@ +Feature: Cleanup Aruba Working Directory + + By default Aruba removes its scratch directory *before* every scenario. This + isn't always the right thing to do, especially when the path to the default + directory has been changed. Use the `@no-clobber`-tag on your scenarios to + stop Aruba from cleaning up *before* it runs. + + Background: + Given I use a fixture named "cli-app" + + Scenario: Clean up artifacts and pwd from a previous scenario + Given a file named "features/cleanup.feature" with: + """ + Feature: Check + Scenario: Check #1 + Given a file named "file.txt" with "content" + And a directory named "dir.d" + Then a file named "file.txt" should exist + And a directory named "dir.d" should exist + When I cd to "dir.d" + And I run `cd` + Then the output should match %r + + Scenario: Check #2 + Then a file named "file.txt" should not exist + And a directory named "dir.d" should not exist + When I run `cd` + Then the output should match %r + """ + When I run `cucumber` + Then the features should all pass + + Scenario: Do not clobber before run + The `@no-clobber` tag stops Aruba from clearing out its scratch directory. + Other setup steps are still performed, such as setting the current working + directory. + + Given a file named "tmp/aruba/file.txt" with "content" + And a directory named "tmp/aruba/dir.d" + And a file named "features/cleanup.feature" with: + """ + Feature: Check + Scenario: Check #1 + Given a file named "file.txt" with "content" + And a directory named "dir.d" + Then a file named "file.txt" should exist + And a directory named "dir.d" should exist + + @no-clobber + Scenario: Check #2 + Then a file named "file.txt" should exist + And a directory named "dir.d" should exist + When I run `cd` + Then the output should match %r + """ + When I run `cucumber` + Then the features should all pass From 5ce50130b6e9cebbd7c2d068e304bc60f959cf91 Mon Sep 17 00:00:00 2001 From: Andrew Walter Date: Sun, 10 Jun 2018 18:45:32 +1000 Subject: [PATCH 10/25] CI: Windows - Fixed CleanUpWorkingDirectory feature. --- .../cleanup_working_directory.feature | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/features/unpublished/windows/01_getting_started_with_aruba/cleanup_working_directory.feature b/features/unpublished/windows/01_getting_started_with_aruba/cleanup_working_directory.feature index aef650f48..bcf336d64 100644 --- a/features/unpublished/windows/01_getting_started_with_aruba/cleanup_working_directory.feature +++ b/features/unpublished/windows/01_getting_started_with_aruba/cleanup_working_directory.feature @@ -19,13 +19,13 @@ Feature: Cleanup Aruba Working Directory And a directory named "dir.d" should exist When I cd to "dir.d" And I run `cd` - Then the output should match %r + Then the output should match %r<\\tmp\\aruba\\dir.d$> Scenario: Check #2 Then a file named "file.txt" should not exist And a directory named "dir.d" should not exist When I run `cd` - Then the output should match %r + Then the output should match %r<\\tmp\\aruba$> """ When I run `cucumber` Then the features should all pass @@ -51,7 +51,7 @@ Feature: Cleanup Aruba Working Directory Then a file named "file.txt" should exist And a directory named "dir.d" should exist When I run `cd` - Then the output should match %r + Then the output should match %r<\\tmp\\aruba$> """ When I run `cucumber` Then the features should all pass From 84f5c542cbe85270340b7d70d19bf498a12a3478 Mon Sep 17 00:00:00 2001 From: Andrew Walter Date: Sun, 10 Jun 2018 18:49:54 +1000 Subject: [PATCH 11/25] Fixed usage of .cucumberproignore file. --- .cucumberproignore | 1 + features/unpublished/.cucumberproignore | 0 2 files changed, 1 insertion(+) delete mode 100644 features/unpublished/.cucumberproignore diff --git a/.cucumberproignore b/.cucumberproignore index a0ccc5267..7c6272895 100644 --- a/.cucumberproignore +++ b/.cucumberproignore @@ -1,3 +1,4 @@ / !features/ features/04_aruba_api/command/run_simple.feature +features/unpublished \ No newline at end of file diff --git a/features/unpublished/.cucumberproignore b/features/unpublished/.cucumberproignore deleted file mode 100644 index e69de29bb..000000000 From 1bc2b7e772770a1cdff516f8ea89225346ffbcfc Mon Sep 17 00:00:00 2001 From: Andrew Walter Date: Sun, 10 Jun 2018 19:02:24 +1000 Subject: [PATCH 12/25] CI: Windows - Fixed 01\getting_started\RunCommands feature. --- 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 40cfc3171895f2a7581a55a6b3846e281fc52686 Mon Sep 17 00:00:00 2001 From: Andrew Walter Date: Sun, 10 Jun 2018 19:27:06 +1000 Subject: [PATCH 13/25] CI: Windows - Fixed supported_testing_frameworks.feature --- .../supported_testing_frameworks.feature | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 d8074a18f..9c9cda1a6 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 @@ -86,3 +86,4 @@ Feature: Supported Testing Frameworks """ When I run `ruby -Ilib:test test/use_aruba_with_minitest.rb` Then the tests should all pass + \ No newline at end of file From d1a0b025d145d25b696a8fabc807d3a85e5e4212 Mon Sep 17 00:00:00 2001 From: Andrew Walter Date: Sun, 10 Jun 2018 19:43:03 +1000 Subject: [PATCH 14/25] Add @requires-sleep hook --- features/step_definitions/hooks.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/features/step_definitions/hooks.rb b/features/step_definitions/hooks.rb index 4ac8e99aa..04b94f387 100644 --- a/features/step_definitions/hooks.rb +++ b/features/step_definitions/hooks.rb @@ -36,6 +36,12 @@ skip_this_scenario end +Before "@requires-sleep" do + next unless Aruba.platform.which("sleep").nil? + + skip_this_scenario +end + Before "@requires-posix-standard-tools" do next unless Aruba.platform.which("printf").nil? From 850d2b9b330283c374dffb14f5560f37422453ac Mon Sep 17 00:00:00 2001 From: Andrew Walter Date: Sun, 10 Jun 2018 19:57:35 +1000 Subject: [PATCH 15/25] CI: Windows - Fixed 02_ConfiguringAruba\CommandRuntimeEnvironment.feature --- .../command_runtime_environment.feature | 1 + features/step_definitions/hooks.rb | 6 + .../command_runtime_environment.feature | 130 ++++++++++++++++++ 3 files changed, 137 insertions(+) create mode 100644 features/unpublished/windows/02_configure_aruba/command_runtime_environment.feature diff --git a/features/02_configure_aruba/command_runtime_environment.feature b/features/02_configure_aruba/command_runtime_environment.feature index 4c0657c8d..352d0275e 100644 --- a/features/02_configure_aruba/command_runtime_environment.feature +++ b/features/02_configure_aruba/command_runtime_environment.feature @@ -1,3 +1,4 @@ +@requires-env @unsupported-on-platform-windows Feature: Define default process environment Say you want to have a default set of environment variables, then use this code. diff --git a/features/step_definitions/hooks.rb b/features/step_definitions/hooks.rb index 04b94f387..83cf72bd7 100644 --- a/features/step_definitions/hooks.rb +++ b/features/step_definitions/hooks.rb @@ -42,6 +42,12 @@ skip_this_scenario end +Before "@requires-env" do + next unless Aruba.platform.which("env").nil? + + skip_this_scenario +end + Before "@requires-posix-standard-tools" do next unless Aruba.platform.which("printf").nil? diff --git a/features/unpublished/windows/02_configure_aruba/command_runtime_environment.feature b/features/unpublished/windows/02_configure_aruba/command_runtime_environment.feature new file mode 100644 index 000000000..4842f4a4f --- /dev/null +++ b/features/unpublished/windows/02_configure_aruba/command_runtime_environment.feature @@ -0,0 +1,130 @@ +@unsupported-on-platform-unix @unsupported-on-platform-mac +Feature: Define default process environment + Say you want to have a default set of environment variables, then use this + code. + + ~~~ruby + Aruba.configure do |config| + config.command_runtime_environment = { 'MY_VARIABLE' => 'x' } + end + ~~~ + + This can be changed via `#set_environment_variable`, + `#append_environment_variable`, `#delete_environment_variable` or + `#prepend_environment_variable`. + + Background: + Given I use the fixture "cli-app" + + Scenario: Overwrite existing variable with new default value + Given a file named "spec/environment_spec.rb" with: + """ruby + require 'spec_helper' + + ENV['LONG_LONG_VARIABLE'] = 'y' + + Aruba.configure do |config| + config.command_runtime_environment = { 'LONG_LONG_VARIABLE' => 'x' } + end + + RSpec.describe 'Environment command', :type => :aruba do + before(:each) { run_command('set') } + before(:each) { stop_all_commands } + + it { expect(last_command_started.output).to include 'LONG_LONG_VARIABLE=x' } + end + """ + When I run `rspec` + Then the specs should all pass + + Scenario: Overwrite default value for variable + Given a file named "spec/environment_spec.rb" with: + """ruby + require 'spec_helper' + + ENV['LONG_LONG_VARIABLE'] = 'y' + + Aruba.configure do |config| + config.command_runtime_environment = { 'LONG_LONG_VARIABLE' => 'x' } + end + + RSpec.describe 'Environment command', :type => :aruba do + before(:each) { set_environment_variable 'LONG_LONG_VARIABLE', 'z' } + + before(:each) { run_command('set') } + before(:each) { stop_all_commands } + + it { expect(last_command_started.output).to include 'LONG_LONG_VARIABLE=z' } + end + """ + When I run `rspec` + Then the specs should all pass + + Scenario: Append value to default value + Given a file named "spec/environment_spec.rb" with: + """ruby + require 'spec_helper' + + ENV['LONG_LONG_VARIABLE'] = 'y' + + Aruba.configure do |config| + config.command_runtime_environment = { 'LONG_LONG_VARIABLE' => 'x' } + end + + RSpec.describe 'Environment command', :type => :aruba do + before(:each) { append_environment_variable 'LONG_LONG_VARIABLE', 'z' } + + before(:each) { run_command('set') } + before(:each) { stop_all_commands } + + it { expect(last_command_started.output).to include 'LONG_LONG_VARIABLE=xz' } + end + """ + When I run `rspec` + Then the specs should all pass + + Scenario: Prepend value + Given a file named "spec/environment_spec.rb" with: + """ruby + require 'spec_helper' + + ENV['LONG_LONG_VARIABLE'] = 'y' + + Aruba.configure do |config| + config.command_runtime_environment = { 'LONG_LONG_VARIABLE' => 'x' } + end + + RSpec.describe 'Environment command', :type => :aruba do + before(:each) { prepend_environment_variable 'LONG_LONG_VARIABLE', 'z' } + + before(:each) { run_command('set') } + before(:each) { stop_all_commands } + + it { expect(last_command_started.output).to include 'LONG_LONG_VARIABLE=zx' } + end + """ + When I run `rspec` + Then the specs should all pass + + Scenario: Remove variable from default set of variables + Given a file named "spec/environment_spec.rb" with: + """ruby + require 'spec_helper' + + ENV['LONG_LONG_VARIABLE'] = 'y' + + Aruba.configure do |config| + config.command_runtime_environment = { 'LONG_LONG_VARIABLE' => 'x' } + end + + RSpec.describe 'Environment command', :type => :aruba do + before(:each) { delete_environment_variable 'LONG_LONG_VARIABLE' } + + before(:each) { run_command('set') } + before(:each) { stop_all_commands } + + it { expect(last_command_started.output).not_to include 'LONG_LONG_VARIABLE' } + end + """ + When I run `rspec` + Then the specs should all pass From 9cc8e13bab3033ec9caf8c01875dfa9deb846231 Mon Sep 17 00:00:00 2001 From: Andrew Walter Date: Sun, 10 Jun 2018 20:43:30 +1000 Subject: [PATCH 16/25] CI: Windows - Skip Exit timeout config. Added ToDo. --- features/02_configure_aruba/exit_timeout.feature | 1 + 1 file changed, 1 insertion(+) diff --git a/features/02_configure_aruba/exit_timeout.feature b/features/02_configure_aruba/exit_timeout.feature index a023bf57b..ab2cf96f0 100644 --- a/features/02_configure_aruba/exit_timeout.feature +++ b/features/02_configure_aruba/exit_timeout.feature @@ -1,3 +1,4 @@ +@unsupported-on-platform-windows @todo-improve-cross-platform-support Feature: Configure timeout for command execution As a developer From 490a74907d6e2e7ccd7b65b94eeb23497f3b8ca8 Mon Sep 17 00:00:00 2001 From: Andrew Walter Date: Sun, 10 Jun 2018 20:47:24 +1000 Subject: [PATCH 17/25] CI: Windows - Fixed 02_Configuring_Aruba\HomeDirectory feature. --- features/02_configure_aruba/home_directory.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/02_configure_aruba/home_directory.feature b/features/02_configure_aruba/home_directory.feature index 065be0eb6..5da4555ee 100644 --- a/features/02_configure_aruba/home_directory.feature +++ b/features/02_configure_aruba/home_directory.feature @@ -22,7 +22,7 @@ Feature: Configure the home directory to be used with aruba When I successfully run `cucumber` Then the output should match: """ - The default value is "/.*/tmp/aruba" + The default value is ".*/tmp/aruba" """ Scenario: Set to current working directory @@ -60,7 +60,7 @@ Feature: Configure the home directory to be used with aruba Then I successfully run `cucumber` Then the output should match: """ - The value is "/.*/tmp/aruba/home" + The value is ".*/tmp/aruba/home" """ Scenario: Set to some other path (deprecated) From dbbb24f629e8aefa0eecca55677e0366fade70ec Mon Sep 17 00:00:00 2001 From: Andrew Walter Date: Sun, 10 Jun 2018 22:07:41 +1000 Subject: [PATCH 18/25] CI: Windows - Fixed 03\testing_frameworks\cucumber\announce_... --- ...ce_information_for_troubleshooting.feature | 1 + ...ce_information_for_troubleshooting.feature | 228 ++++++++++++++++++ 2 files changed, 229 insertions(+) create mode 100644 features/unpublished/windows/03_testing_frameworks/cucumber/announce_information_for_troubleshooting.feature diff --git a/features/03_testing_frameworks/cucumber/announce_information_for_troubleshooting.feature b/features/03_testing_frameworks/cucumber/announce_information_for_troubleshooting.feature index ffde77843..e0dbe9319 100644 --- a/features/03_testing_frameworks/cucumber/announce_information_for_troubleshooting.feature +++ b/features/03_testing_frameworks/cucumber/announce_information_for_troubleshooting.feature @@ -1,3 +1,4 @@ +@requires-bash Feature: Announce output during test run In order to specify expected output diff --git a/features/unpublished/windows/03_testing_frameworks/cucumber/announce_information_for_troubleshooting.feature b/features/unpublished/windows/03_testing_frameworks/cucumber/announce_information_for_troubleshooting.feature new file mode 100644 index 000000000..df31aeb1b --- /dev/null +++ b/features/unpublished/windows/03_testing_frameworks/cucumber/announce_information_for_troubleshooting.feature @@ -0,0 +1,228 @@ +@unsupported-on-platform-unix @unsupported-on-platform-mac +Feature: Announce output during test run + + In order to specify expected output + As a developer using Cucumber + I want to use the "the output should contain" step + + Background: + Given I use a fixture named "cli-app" + + + Scenario: Announce change of directory + Given a file named "features/exit_status.feature" with: + """cucumber + Feature: Announce + @announce-directory + Scenario: Run command + Given a directory named "dir.d" + When I cd to "dir.d" + """ + When I run `cucumber` + Then the features should all pass + And the output should contain: + """ + $ cd C:/ + """ + And the output should contain: + """ + tmp/aruba/dir.d + """ + + Scenario: Announce stdout + Given an executable named "bin/aruba-test-cli.bat" with: + """bash + @echo off + echo Hello World + """ + And a file named "features/exit_status.feature" with: + """cucumber + Feature: Announce + @announce-stdout + Scenario: Run command + When I run `aruba-test-cli.bat` + Then the exit status should be 0 + """ + When I run `cucumber` + Then the features should all pass + And the output should match %r<<<-STDOUT\s*Hello World\s*STDOUT> + + Scenario: Announce stderr + Given an executable named "bin/aruba-test-cli.bat" with: + """bash + @echo off + echo Hello World >&2 + """ + And a file named "features/exit_status.feature" with: + """cucumber + Feature: Announce + @announce-stderr + Scenario: Run command + When I run `aruba-test-cli.bat` + Then the exit status should be 0 + """ + When I run `cucumber` + Then the features should all pass + And the output should match %r<<<-STDERR\s*Hello World\s*STDERR> + + Scenario: Announce both stderr and stdout + Given an executable named "bin/aruba-test-cli.bat" with: + """bash + @echo off + echo Hello >&2 + echo World + """ + And a file named "features/exit_status.feature" with: + """cucumber + Feature: Announce + @announce-output + Scenario: Run command + When I run `aruba-test-cli.bat` + Then the exit status should be 0 + """ + When I run `cucumber` + Then the features should all pass + And the output should match %r<<<-STDERR\s*Hello\s*STDERR> + And the output should match %r<<<-STDOUT\s*World\s*STDOUT> + + Scenario: Announce command + Given an executable named "bin/aruba-test-cli.bat" with: + """bash + @echo off + echo Hello World + """ + And a file named "features/exit_status.feature" with: + """cucumber + Feature: Announce + @announce-command + Scenario: Run command + When I run `aruba-test-cli.bat` + Then the exit status should be 0 + """ + When I run `cucumber` + Then the features should all pass + And the output should contain: + """ + $ aruba-test-cli + """ + + Scenario: Announce change of environment variable + Given an executable named "bin/aruba-test-cli.bat" with: + """bash + @echo off + echo Hello World + """ + And a file named "features/exit_status.feature" with: + """cucumber + Feature: Announce + @announce-changed-environment + Scenario: Run command + When I set the environment variables to: + | variable | value | + | MY_VAR | my_value | + And I run `aruba-test-cli.bat` + Then the exit status should be 0 + """ + When I run `cucumber` + Then the features should all pass + And the output should contain: + """ + $ export MY_VAR=my_value + """ + + Scenario: Announce change of environment variable which contains special characters + Given an executable named "bin/aruba-test-cli.bat" with: + """bash + @echo off + echo Hello World + """ + And a file named "features/exit_status.feature" with: + """cucumber + Feature: Announce + @announce-changed-environment + Scenario: Run command + When I set the environment variables to: + | variable | value | + | MY_VAR | my value ! | + And I run `aruba-test-cli.bat` + Then the exit status should be 0 + """ + When I run `cucumber` + Then the features should all pass + And the output should contain: + """ + $ export MY_VAR=my\ value\ \ + """ + + Scenario: Announce file system status of command + This will output information like owner, group, atime, mtime, ctime, size, + mode and if command is executable. + + Given an executable named "bin/aruba-test-cli.bat" with: + """bash + @echo off + echo Hello World + """ + And a file named "features/exit_status.feature" with: + """cucumber + Feature: Announce + @announce-command-filesystem-status + Scenario: Run command + And I run `aruba-test-cli.bat` + Then the exit status should be 0 + """ + When I run `cucumber` + Then the features should all pass + And the output should contain: + """ + # mode => 755 + """ + And the output should contain: + """ + # owner + """ + And the output should contain: + """ + # group + """ + And the output should contain: + """ + # ctime + """ + And the output should contain: + """ + # mtime + """ + And the output should contain: + """ + # atime + """ + And the output should contain: + """ + # size + """ + And the output should contain: + """ + # executable + """ + + Scenario: Announce content of command + This will output the content of the executable command. Be careful doing + this with binary executables. This hook should be used with scripts only. + + Given an executable named "bin/aruba-test-cli.bat" with: + """bash + @echo off + echo Hello World + """ + And a file named "features/exit_status.feature" with: + """cucumber + Feature: Announce + @announce-command-content + Scenario: Run command + And I run `aruba-test-cli.bat` + Then the exit status should be 0 + """ + When I run `cucumber` + Then the features should all pass + And the output should match %r<@echo off\s*echo Hello World> \ No newline at end of file From cc4e3a6a3dec39efeb2073aba1f3a365f0cdeb8b Mon Sep 17 00:00:00 2001 From: Andrew Walter Date: Sun, 10 Jun 2018 22:29:18 +1000 Subject: [PATCH 19/25] CI: Windows - Fixed `disabling bundler` feature. --- .../cucumber/disable_bunder.feature | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 features/unpublished/windows/03_testing_frameworks/cucumber/disable_bunder.feature diff --git a/features/unpublished/windows/03_testing_frameworks/cucumber/disable_bunder.feature b/features/unpublished/windows/03_testing_frameworks/cucumber/disable_bunder.feature new file mode 100644 index 000000000..d2b28c971 --- /dev/null +++ b/features/unpublished/windows/03_testing_frameworks/cucumber/disable_bunder.feature @@ -0,0 +1,19 @@ +@unsupported-on-platform-unix @unsupported-on-platform-mac +Feature: Disable Bundler environment + Use the @disable-bundler tag to escape from your project's Gemfile. + + Background: + Given I use the fixture "cli-app" + + Scenario: Clear the Bundler environment + + Given a file named "features/run.feature" with: + """ + Feature: My Feature + @disable-bundler + Scenario: Check environment + When I run `set` + Then the output should not match /^BUNDLE_GEMFILE=/ + """ + When I run `cucumber` + Then the features should all pass From 30a138782d78b3bf3af697283eb36e2762a6441e Mon Sep 17 00:00:00 2001 From: Andrew Walter Date: Sun, 10 Jun 2018 22:36:24 +1000 Subject: [PATCH 20/25] CI: Windows - Fix `define_after_hook_for_commands` feature. --- .../define_after_hook_for_commands.feature | 1 + features/step_definitions/hooks.rb | 6 +++ .../define_after_hook_for_commands.feature | 52 +++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 features/unpublished/windows/03_testing_frameworks/cucumber/hooks/define_after_hook_for_commands.feature diff --git a/features/03_testing_frameworks/cucumber/hooks/define_after_hook_for_commands.feature b/features/03_testing_frameworks/cucumber/hooks/define_after_hook_for_commands.feature index e7b15b3ba..8e62d710e 100644 --- a/features/03_testing_frameworks/cucumber/hooks/define_after_hook_for_commands.feature +++ b/features/03_testing_frameworks/cucumber/hooks/define_after_hook_for_commands.feature @@ -18,6 +18,7 @@ Feature: After command hooks Background: Given I use a fixture named "cli-app" + @requires-cat Scenario: Run a simple command with an "after(:command)"-hook Given a file named "features/support/hooks.rb" with: """ diff --git a/features/step_definitions/hooks.rb b/features/step_definitions/hooks.rb index 83cf72bd7..4f31c7a2c 100644 --- a/features/step_definitions/hooks.rb +++ b/features/step_definitions/hooks.rb @@ -48,6 +48,12 @@ skip_this_scenario end +Before "@requires-cat" do + next unless Aruba.platform.which("cat").nil? + + skip_this_scenario +end + Before "@requires-posix-standard-tools" do next unless Aruba.platform.which("printf").nil? diff --git a/features/unpublished/windows/03_testing_frameworks/cucumber/hooks/define_after_hook_for_commands.feature b/features/unpublished/windows/03_testing_frameworks/cucumber/hooks/define_after_hook_for_commands.feature new file mode 100644 index 000000000..046a572ed --- /dev/null +++ b/features/unpublished/windows/03_testing_frameworks/cucumber/hooks/define_after_hook_for_commands.feature @@ -0,0 +1,52 @@ +@unsupported-on-platform-unix @unsupported-on-platform-mac +Feature: After command hooks + + You can configure Aruba to run blocks of code after it has run + a command. The command will be passed to the block. + + You can hook into Aruba's lifecycle just before it runs a command and after it has run the command: + + ```ruby + require 'aruba' + + Aruba.configure do |config| + config.after :command do |cmd| + puts "After the run of '#{cmd}'" + end + end + ``` + + Background: + Given I use a fixture named "cli-app" + + Scenario: Run a simple command with an "after(:command)"-hook + Given a file named "features/support/hooks.rb" with: + """ + require_relative 'aruba' + + Aruba.configure do |config| + config.after :command do |cmd| + puts "after the run of `#{cmd.commandline}`" + end + end + """ + And a file named "features/use_aruba_with_cucumber.feature" with: + """ + Feature: Cucumber + Scenario: First Run + Given a file named "file.txt" with: + \"\"\" + Hello World + \"\"\" + When I successfully run `type file.txt` + Then the output should contain: + \"\"\" + Hello World + \"\"\" + """ + When I run `cucumber` + Then the features should all pass + And the output should contain: + """ + after the run of `type file.txt` + """ From 7b0aabbce0a40903fb28b6ae6d7bba034ab3165c Mon Sep 17 00:00:00 2001 From: Andrew Walter Date: Sun, 10 Jun 2018 22:43:55 +1000 Subject: [PATCH 21/25] CI: Windows - Fix `define_before_hook_for_commands` feature. (Cucumber) --- .../define_before_hook_for_commands.feature | 1 + .../define_before_hook_for_commands.feature | 54 +++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 features/unpublished/windows/03_testing_frameworks/cucumber/hooks/define_before_hook_for_commands.feature diff --git a/features/03_testing_frameworks/cucumber/hooks/define_before_hook_for_commands.feature b/features/03_testing_frameworks/cucumber/hooks/define_before_hook_for_commands.feature index 3e6eba456..eef5d9298 100644 --- a/features/03_testing_frameworks/cucumber/hooks/define_before_hook_for_commands.feature +++ b/features/03_testing_frameworks/cucumber/hooks/define_before_hook_for_commands.feature @@ -1,3 +1,4 @@ +@requires-cat Feature: before_cmd hooks You can configure Aruba to run blocks of code before it runs diff --git a/features/unpublished/windows/03_testing_frameworks/cucumber/hooks/define_before_hook_for_commands.feature b/features/unpublished/windows/03_testing_frameworks/cucumber/hooks/define_before_hook_for_commands.feature new file mode 100644 index 000000000..2b440324b --- /dev/null +++ b/features/unpublished/windows/03_testing_frameworks/cucumber/hooks/define_before_hook_for_commands.feature @@ -0,0 +1,54 @@ +@unsupported-on-platform-mac @unsupported-on-platform-unix +Feature: before_cmd hooks + + You can configure Aruba to run blocks of code before it runs + each command. + + The command will be passed to the block. + + You can hook into Aruba's lifecycle just before it runs a command and after it has run the command: + + ```ruby + require_relative 'aruba' + + Aruba.configure do |config| + config.before :command do |cmd| + puts "About to run '#{cmd}'" + end + end + ``` + + Background: + Given I use a fixture named "cli-app" + + Scenario: Run a simple command with an "after(:command)"-hook + Given a file named "features/support/hooks.rb" with: + """ + require_relative 'aruba' + + Aruba.configure do |config| + config.before :command do |cmd| + puts "before the run of `#{cmd.commandline}`" + end + end + """ + And a file named "features/use_aruba_with_cucumber.feature" with: + """ + Feature: Cucumber + Scenario: First Run + Given a file named "file.txt" with: + \"\"\" + Hello World + \"\"\" + When I successfully run `type file.txt` + Then the output should contain: + \"\"\" + Hello World + \"\"\" + """ + When I run `cucumber` + Then the features should all pass + And the output should contain: + """ + before the run of `type file.txt` + """ From cccd29b965e85102c0d10431d5766e40161c3c7e Mon Sep 17 00:00:00 2001 From: Andrew Walter Date: Sun, 10 Jun 2018 23:36:19 +1000 Subject: [PATCH 22/25] CI: Windows - Fixed `check_for_exit_status` feature (Cucumber) --- .../command/check_for_exit_statuses.feature | 4 +- features/step_definitions/hooks.rb | 6 + .../command/check_for_exit_statuses.feature | 131 ++++++++++++++++++ 3 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 features/unpublished/windows/03_testing_frameworks/cucumber/steps/command/check_for_exit_statuses.feature diff --git a/features/03_testing_frameworks/cucumber/steps/command/check_for_exit_statuses.feature b/features/03_testing_frameworks/cucumber/steps/command/check_for_exit_statuses.feature index d3405e762..756b9ca05 100644 --- a/features/03_testing_frameworks/cucumber/steps/command/check_for_exit_statuses.feature +++ b/features/03_testing_frameworks/cucumber/steps/command/check_for_exit_statuses.feature @@ -1,3 +1,4 @@ +@requires-bash Feature: Check exit status of commands Use the `the exit status should be \d`-step to check the exit status of the @@ -6,7 +7,7 @@ Feature: Check exit status of commands Background: Given I use a fixture named "cli-app" - + Scenario: Test for exit status of 0 Given an executable named "bin/aruba-test-cli" with: """ @@ -85,6 +86,7 @@ Feature: Check exit status of commands When I run `cucumber` Then the features should not all pass + @requires-sleep Scenario: Overwrite the default exit timeout via step Given an executable named "bin/aruba-test-cli" with: """ diff --git a/features/step_definitions/hooks.rb b/features/step_definitions/hooks.rb index 4f31c7a2c..403290529 100644 --- a/features/step_definitions/hooks.rb +++ b/features/step_definitions/hooks.rb @@ -54,6 +54,12 @@ skip_this_scenario end +Before "@requires-platform-windows" do + next if FFI::Platform.windows? + + skip_this_scenario +end + Before "@requires-posix-standard-tools" do next unless Aruba.platform.which("printf").nil? diff --git a/features/unpublished/windows/03_testing_frameworks/cucumber/steps/command/check_for_exit_statuses.feature b/features/unpublished/windows/03_testing_frameworks/cucumber/steps/command/check_for_exit_statuses.feature new file mode 100644 index 000000000..075a7f797 --- /dev/null +++ b/features/unpublished/windows/03_testing_frameworks/cucumber/steps/command/check_for_exit_statuses.feature @@ -0,0 +1,131 @@ +@requires-platform-windows +Feature: Check exit status of commands + + Use the `the exit status should be \d`-step to check the exit status of the + last command which was finished. If no commands have finished yet, it stops + the one that was started last. + + Background: + Given I use a fixture named "cli-app" + + + Scenario: Test for exit status of 0 + Given an executable named "bin/aruba-test-cli.bat" with: + """ + exit 0 + """ + And a file named "features/exit_status.feature" with: + """ + Feature: Exit status + Scenario: Run command + When I run `aruba-test-cli` + Then the exit status should be 0 + """ + When I run `cucumber` + Then the features should all pass + + Scenario: Test for exit status 1 + Given an executable named "bin/aruba-test-cli.bat" with: + """ + exit 1 + """ + And a file named "features/exit_status.feature" with: + """ + Feature: Failing program + Scenario: Run command + When I run `aruba-test-cli` + Then the exit status should be 1 + """ + When I run `cucumber` + Then the features should all pass + + Scenario: Test for non-zero exit status + Given an executable named "bin/aruba-test-cli.bat" with: + """ + exit 1 + """ + And a file named "features/exit_status.feature" with: + """ + Feature: Failing program + Scenario: Run command + When I run `aruba-test-cli` + Then the exit status should not be 0 + """ + When I run `cucumber` + Then the features should all pass + + Scenario: Successfully run something + Given an executable named "bin/aruba-test-cli.bat" with: + """ + exit 0 + """ + And a file named "features/exit_status.feature" with: + """ + Feature: Failing program + Scenario: Run command + When I successfully run `aruba-test-cli` + """ + When I run `cucumber` + Then the features should all pass + + Scenario: Fail to run something successfully + Given an executable named "bin/aruba-test-cli.bat" with: + """ + exit 1 + """ + And a file named "features/exit_status.feature" with: + """ + Feature: Failing program + Scenario: Run command + When I successfully run `aruba-test-cli` + """ + When I run `cucumber` + Then the features should not all pass + + Scenario: Overwrite the default exit timeout via step + Given an executable named "bin/aruba-test-cli.bat" with: + """ + ruby -e 'sleep 0.1' + """ + And a file named "features/exit_status.feature" with: + """ + Feature: Failing program + Scenario: Run command + Given the default aruba exit timeout is 3.5 seconds + When I successfully run `aruba-test-cli` + """ + When I run `cucumber` + Then the features should all pass + + Scenario: Successfully run something longer then the default time + Given an executable named "bin/aruba-test-cli.bat" with: + """ + ruby -e 'sleep 0.1' + """ + And a file named "features/exit_status.feature" with: + """ + Feature: Failing program + Scenario: Run command + Given the default aruba exit timeout is 0 seconds + When I successfully run `aruba-test-cli` for up to 5.1 seconds + """ + When I run `cucumber` + Then the features should all pass + + Scenario: Unsuccessfully run something that takes too long + Given an executable named "bin/aruba-test-cli.bat" with: + """ + ruby -e 'sleep 0.1' + """ + And a file named "features/exit_status.feature" with: + """ + Feature: Failing program + Scenario: Run command + Given the default aruba exit timeout is 0 seconds + When I successfully run `aruba-test-cli` + """ + When I run `cucumber` + Then the features should not all pass with: + """ + expected "aruba-test-cli" to have finished in time + """ From 48a2c993b85930a0b0c5090cf146bfc4992b3fe3 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sat, 19 Jun 2021 13:01:05 +0200 Subject: [PATCH 23/25] Mark Windows-only version of Cleanup Working Directory feature as such --- .../cleanup_working_directory.feature | 2 ++ 1 file changed, 2 insertions(+) diff --git a/features/unpublished/windows/01_getting_started_with_aruba/cleanup_working_directory.feature b/features/unpublished/windows/01_getting_started_with_aruba/cleanup_working_directory.feature index bcf336d64..ca18768ec 100644 --- a/features/unpublished/windows/01_getting_started_with_aruba/cleanup_working_directory.feature +++ b/features/unpublished/windows/01_getting_started_with_aruba/cleanup_working_directory.feature @@ -8,6 +8,7 @@ Feature: Cleanup Aruba Working Directory Background: Given I use a fixture named "cli-app" + @requires-platform-windows Scenario: Clean up artifacts and pwd from a previous scenario Given a file named "features/cleanup.feature" with: """ @@ -30,6 +31,7 @@ Feature: Cleanup Aruba Working Directory When I run `cucumber` Then the features should all pass + @requires-platform-windows Scenario: Do not clobber before run The `@no-clobber` tag stops Aruba from clearing out its scratch directory. Other setup steps are still performed, such as setting the current working From d3a6cbe2a7bc5b32b38f87440f3a84cdf82ebdd4 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sat, 19 Jun 2021 14:24:17 +0200 Subject: [PATCH 24/25] WIP: Disable ... --- 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 7de6b5ad3..8b1896b35 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 From 08a250a755d83bbb8d40ced9f45cbe97e96f9013 Mon Sep 17 00:00:00 2001 From: Andrew Walter Date: Sun, 10 Jun 2018 19:43:03 +1000 Subject: [PATCH 25/25] CI: Windows - Fixed ConfuringAruba\Basics.feature --- features/02_configure_aruba/basics.feature | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/features/02_configure_aruba/basics.feature b/features/02_configure_aruba/basics.feature index a95bca709..eaf88f077 100644 --- a/features/02_configure_aruba/basics.feature +++ b/features/02_configure_aruba/basics.feature @@ -1,3 +1,4 @@ +@requires-sleep @todo-improve-cross-platform-support Feature: Usage of configuration You can configure `aruba` in two ways: @@ -33,12 +34,12 @@ Feature: Usage of configuration RSpec.describe 'Run command', :type => :aruba do context 'when fast command' do - before { run_command('aruba-test-cli 0') } + before { run_command('ruby ./aruba-test-cli 0') } it { expect(last_command_started).to be_successfully_executed } end context 'when slow command' do - before { run_command('aruba-test-cli 1') } + before { run_command('ruby ./aruba-test-cli 1') } it { expect(last_command_started).not_to be_successfully_executed } end end @@ -74,17 +75,17 @@ Feature: Usage of configuration RSpec.describe 'Run command', :type => :aruba do context 'when fast command' do - before { run_command('aruba-test-cli 0') } + before { run_command('ruby ./aruba-test-cli 0') } it { expect(last_command_started).to be_successfully_executed } end context 'when slow command and this is known by the developer', :slow_command => true do - before { run_command('aruba-test-cli 1') } + before { run_command('ruby ./aruba-test-cli 1') } it { expect(last_command_started).to be_successfully_executed } end context 'when slow command, but this might be a failure' do - before { run_command('aruba-test-cli 1') } + before { run_command('ruby ./aruba-test-cli 1') } it { expect(last_command_started).not_to be_successfully_executed } end end @@ -103,11 +104,11 @@ Feature: Usage of configuration """ Feature: Run it Scenario: Fast command - When I run `aruba-test-cli 0` + When I run `ruby ./aruba-test-cli 0` Then the exit status should be 0 Scenario: Slow command - When I run `aruba-test-cli 1.0` + When I run `ruby ./aruba-test-cli 1.0` Then the exit status should be 128 """ When I run `cucumber` @@ -135,16 +136,16 @@ Feature: Usage of configuration """ Feature: Run it Scenario: Fast command - When I run `aruba-test-cli 0` + When I run `ruby ./aruba-test-cli 0` Then the exit status should be 0 @slow-command Scenario: Slow command known by the developer - When I run `aruba-test-cli 0.5` + When I run `ruby ./aruba-test-cli 0.5` Then the exit status should be 0 Scenario: Slow command which might be a failure - When I run `aruba-test-cli 0.5` + When I run `ruby ./aruba-test-cli 0.5` Then the exit status should be 128 """ When I run `cucumber`