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 pathrun_commands.feature
187 lines (168 loc) · 5.17 KB
/
run_commands.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
Feature: Run commands with Aruba
As long as you've got the neccessary programs, libraries, runtime
environments, interpreters installed, it doesn't matter in which programming
language your commandline application is implemented. You can even use POSIX
standard tools like "printf".
Below you find some examples of the "Hello, Aruba!"-application implemented
with different programming languages and a single example for a POSIX
standard tool. This is NOT an exclusive list. Every commandline application
should run with `aruba`.
Background:
Given I use a fixture named "getting-started-app"
And a file named "features/hello_aruba.feature" with:
"""
Feature: Getting Started With Aruba
Scenario: First Run of Command
Given I successfully run `cli`
Then the output should contain:
\"\"\"
Hello, Aruba!
\"\"\"
"""
@requires-bash
Scenario: Bash Program
Given an executable named "bin/aruba-test-cli" with:
"""bash
#!/usr/bin/env bash
echo "Hello, Aruba!"
"""
When I successfully run `cucumber`
Then the features should all pass
@requires-bash
Scenario: Bash Program run via bash
Given a file named "features/hello_aruba.feature" with:
"""
Feature: Getting Started With Aruba
Scenario: First Run of Command
Given a file named "cli.sh" with:
\"\"\"
echo "Hello, Aruba!"
\"\"\"
When I successfully run `bash ./cli.sh`
Then the output should contain:
\"\"\"
Hello, Aruba!
\"\"\"
"""
When I successfully run `cucumber`
Then the features should all pass
@requires-ruby
Scenario: Ruby Program
Given an executable named "bin/aruba-test-cli" with:
"""ruby
#!/usr/bin/env ruby
puts "Hello, Aruba!"
"""
When I successfully run `cucumber`
Then the features should all pass
@requires-ruby
Scenario: Ruby Program via "ruby"
Given a file named "features/hello_aruba.feature" with:
"""
Feature: Getting Started With Aruba
Scenario: First Run of Command
Given a file named "cli.rb" with:
\"\"\"
puts "Hello, Aruba!"
\"\"\"
When I successfully run `ruby ./cli.rb`
Then the output should contain:
\"\"\"
Hello, Aruba!
\"\"\"
"""
When I successfully run `cucumber`
Then the features should all pass
@requires-python
Scenario: Python Program
Given an executable named "bin/aruba-test-cli" with:
"""python
#!/usr/bin/env python
print("Hello, Aruba!")
"""
When I successfully run `cucumber`
Then the features should all pass
@requires-python
Scenario: Python Program via "python"
Given a file named "features/hello_aruba.feature" with:
"""
Feature: Getting Started With Aruba
Scenario: First Run of Command
Given a file named "cli.py" with:
\"\"\"
print("Hello, Aruba!")
\"\"\"
When I successfully run `python ./cli.py`
Then the output should contain:
\"\"\"
Hello, Aruba!
\"\"\"
"""
When I successfully run `cucumber`
Then the features should all pass
@requires-perl
Scenario: Perl Program
Given an executable named "bin/aruba-test-cli" with:
"""perl
#!/usr/bin/env perl
print "Hello, Aruba!\n";
"""
When I successfully run `cucumber`
Then the features should all pass
@requires-perl
Scenario: Perl Program via "perl"
Given a file named "features/hello_aruba.feature" with:
"""
Feature: Getting Started With Aruba
Scenario: First Run of Command
Given a file named "cli.pl" with:
\"\"\"perl
print "Hello, Aruba!\n";
\"\"\"
When I successfully run `perl ./cli.pl`
Then the output should contain:
\"\"\"
Hello, Aruba!
\"\"\"
"""
When I successfully run `cucumber`
Then the features should all pass
@requires-java
Scenario: Java Program
It's even possible to compile and run Java programs with Aruba.
Given a file named "features/hello_aruba.feature" with:
"""cucumber
Feature: Getting Started With Aruba
Scenario: First Run of Command
Given a file named "tmp/HelloArubaApp.java" with:
\"\"\"
class HelloArubaApp {
public static void main(String[] args) {
System.out.println("Hello, Aruba!");
}
}
\"\"\"
And I successfully run `javac tmp/HelloArubaApp.java`
And I cd to "tmp/"
And I successfully run `java HelloArubaApp`
Then the output should contain:
\"\"\"
Hello, Aruba!
\"\"\"
"""
When I successfully run `cucumber`
Then the features should all pass
@requires-posix-standard-tools
Scenario: POSIX standard tools
Given a file named "features/hello_aruba.feature" with:
"""
Feature: Getting Started With Aruba
Scenario: First Run of Command
Given I successfully run `printf "%s" "Hello, Aruba!"`
Then the output should contain:
\"\"\"
Hello, Aruba!
\"\"\"
"""
When I successfully run `cucumber`
Then the features should all pass