-
-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Windows - Fixed
check_for_exit_status
feature (Cucumber)
- Loading branch information
1 parent
dbfaaaa
commit 962157e
Showing
3 changed files
with
144 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
131 changes: 131 additions & 0 deletions
131
...shed/windows/03_testing_frameworks/cucumber/steps/command/check_for_exit_statuses.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
""" |