This repository has been archived by the owner on Mar 1, 2019. It is now read-only.
forked from cucumber/aruba
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.feature
86 lines (71 loc) · 2.22 KB
/
setup.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
Feature: Getting started with Cucumber and aruba
Background:
Given I use the fixture "empty-app"
Scenario: Simple Integration
To use the simple integration just require `aruba/cucumber` in your
`features/support/env.rb`.
The simple integration adds some `Before`-hooks for you:
\* Setup Aruba Test directory
\* Clear environment (ENV)
\* Make HOME-variable configurable via `aruba.config.home_directory`
\* Activate announcers based on `@announce-<name>`-tags
Given a file named "features/support/env.rb" with:
"""
require 'aruba/cucumber'
"""
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
\"\"\"
Then the file "file.txt" should contain:
\"\"\"
Hello World
\"\"\"
"""
When I run `cucumber`
Then the features should all pass
Scenario: Custom Integration
There might be some use cases where you want to build an aruba integration
of your own. You need to include the API and make sure, that you run
\* `setup_aruba`
\* `terminate_all_commands`
before any method of aruba is used.
Given a file named "features/support/env.rb" with:
"""
require 'aruba/api'
World(Aruba::Api)
Before do
# Make sure you command can be found by "aruba"
prepend_environment_variable 'PATH', aruba.config.command_search_paths.join(':') + ':'
# Mock HOME-directory
set_environment_variable 'HOME', aruba.config.home_directory
end
# Make sure you command can be found by "aruba"
After do
terminate_all_commands
aruba.command_monitor.clear
end
# Clean up
Before('~@no-clobber') do
setup_aruba
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
\"\"\"
Then the file "file.txt" should contain:
\"\"\"
Hello World
\"\"\"
"""
When I run `cucumber`
Then the features should all pass