-
-
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 - Fix
define_before_hook_for_commands
feature. (Cucumber)
- Loading branch information
1 parent
1dc1021
commit b6de338
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
features/03_testing_frameworks/cucumber/hooks/define_before_hook_for_commands.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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
@requires-cat | ||
Feature: before_cmd hooks | ||
|
||
You can configure Aruba to run blocks of code before it runs | ||
|
54 changes: 54 additions & 0 deletions
54
...shed/windows/03_testing_frameworks/cucumber/hooks/define_before_hook_for_commands.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,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` | ||
""" |