aruba 1.0.0.pre.alpha.2 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/PULL_REQUEST_TEMPLATE.md +2 -1
- data/.rspec +0 -1
- data/.rubocop.yml +46 -182
- data/.rubocop_todo.yml +216 -0
- data/.simplecov +7 -5
- data/.travis.yml +56 -40
- data/.yardopts +3 -0
- data/CHANGELOG.md +1312 -0
- data/CONTRIBUTING.md +175 -83
- data/Gemfile +5 -69
- data/LICENSE +1 -1
- data/README.md +58 -21
- data/Rakefile +27 -54
- data/appveyor.yml +7 -10
- data/aruba.gemspec +38 -19
- data/bin/console +3 -12
- data/cucumber.yml +4 -22
- data/exe/aruba +1 -1
- data/fixtures/cli-app/README.md +1 -1
- data/fixtures/cli-app/Rakefile +1 -1
- data/fixtures/cli-app/bin/aruba-test-cli +1 -1
- data/fixtures/cli-app/cli-app.gemspec +4 -4
- data/fixtures/cli-app/lib/cli/app.rb +1 -1
- data/fixtures/cli-app/lib/cli/app/suppress_simple_cov_output.rb +3 -3
- data/fixtures/cli-app/lib/cli/app/version.rb +1 -1
- data/fixtures/cli-app/spec/spec_helper.rb +3 -2
- data/fixtures/empty-app/Rakefile +1 -1
- data/fixtures/empty-app/cli-app.gemspec +4 -4
- data/fixtures/empty-app/lib/cli/app.rb +0 -2
- data/fixtures/empty-app/lib/cli/app/version.rb +1 -1
- data/fixtures/getting-started-app/Gemfile +1 -1
- data/lib/aruba/api.rb +8 -15
- data/lib/aruba/api/bundler.rb +16 -0
- data/lib/aruba/api/commands.rb +272 -0
- data/lib/aruba/api/core.rb +82 -43
- data/lib/aruba/api/environment.rb +24 -7
- data/lib/aruba/api/filesystem.rb +66 -64
- data/lib/aruba/api/text.rb +17 -11
- data/lib/aruba/aruba_path.rb +25 -111
- data/lib/aruba/basic_configuration.rb +8 -25
- data/lib/aruba/basic_configuration/option.rb +2 -2
- data/lib/aruba/cli.rb +4 -1
- data/lib/aruba/colorizer.rb +10 -99
- data/lib/aruba/command.rb +4 -0
- data/lib/aruba/config/jruby.rb +15 -5
- data/lib/aruba/config_wrapper.rb +17 -2
- data/lib/aruba/configuration.rb +107 -0
- data/lib/aruba/console.rb +5 -7
- data/lib/aruba/console/help.rb +5 -2
- data/lib/aruba/contracts/absolute_path.rb +3 -3
- data/lib/aruba/contracts/is_power_of_two.rb +2 -2
- data/lib/aruba/contracts/relative_path.rb +3 -3
- data/lib/aruba/cucumber.rb +0 -3
- data/lib/aruba/cucumber/command.rb +227 -190
- data/lib/aruba/cucumber/environment.rb +1 -1
- data/lib/aruba/cucumber/file.rb +56 -50
- data/lib/aruba/cucumber/hooks.rb +10 -63
- data/lib/aruba/cucumber/testing_frameworks.rb +76 -50
- data/lib/aruba/event_bus.rb +4 -2
- data/lib/aruba/event_bus/name_resolver.rb +10 -10
- data/lib/aruba/events.rb +2 -1
- data/lib/aruba/hooks.rb +3 -5
- data/lib/aruba/in_config_wrapper.rb +10 -3
- data/lib/aruba/initializer.rb +40 -34
- data/lib/aruba/matchers/base/base_matcher.rb +2 -11
- data/lib/aruba/matchers/base/message_indenter.rb +19 -0
- data/lib/aruba/matchers/base/object_formatter.rb +2 -7
- data/lib/aruba/matchers/collection/include_an_object.rb +11 -13
- data/lib/aruba/matchers/command/be_successfully_executed.rb +8 -4
- data/lib/aruba/matchers/command/have_exit_status.rb +16 -4
- data/lib/aruba/matchers/command/have_finished_in_time.rb +5 -5
- data/lib/aruba/matchers/command/have_output.rb +12 -5
- data/lib/aruba/matchers/command/have_output_on_stderr.rb +4 -2
- data/lib/aruba/matchers/command/have_output_on_stdout.rb +4 -2
- data/lib/aruba/matchers/command/have_output_size.rb +2 -2
- data/lib/aruba/matchers/directory/be_an_existing_directory.rb +5 -7
- data/lib/aruba/matchers/directory/have_sub_directory.rb +10 -7
- data/lib/aruba/matchers/file/be_a_command_found_in_path.rb +2 -4
- data/lib/aruba/matchers/file/be_an_existing_executable.rb +4 -6
- data/lib/aruba/matchers/file/be_an_existing_file.rb +5 -7
- data/lib/aruba/matchers/file/have_file_content.rb +4 -4
- data/lib/aruba/matchers/file/have_file_size.rb +8 -8
- data/lib/aruba/matchers/file/have_same_file_content.rb +9 -12
- data/lib/aruba/matchers/path/a_path_matching_pattern.rb +2 -4
- data/lib/aruba/matchers/path/be_an_absolute_path.rb +3 -5
- data/lib/aruba/matchers/path/be_an_existing_path.rb +4 -6
- data/lib/aruba/matchers/path/have_permissions.rb +8 -8
- data/lib/aruba/matchers/string/include_output_string.rb +8 -10
- data/lib/aruba/matchers/string/match_output_string.rb +9 -11
- data/lib/aruba/matchers/string/output_string_eq.rb +7 -9
- data/lib/aruba/platform.rb +0 -8
- data/lib/aruba/platforms/announcer.rb +60 -85
- data/lib/aruba/platforms/aruba_file_creator.rb +4 -2
- data/lib/aruba/platforms/aruba_fixed_size_file_creator.rb +8 -3
- data/lib/aruba/platforms/aruba_logger.rb +22 -2
- data/lib/aruba/platforms/command_monitor.rb +15 -102
- data/lib/aruba/platforms/determine_disk_usage.rb +56 -19
- data/lib/aruba/platforms/filesystem_status.rb +9 -9
- data/lib/aruba/platforms/local_environment.rb +2 -2
- data/lib/aruba/platforms/simple_table.rb +3 -11
- data/lib/aruba/platforms/unix_command_string.rb +7 -4
- data/lib/aruba/platforms/unix_environment_variables.rb +19 -26
- data/lib/aruba/platforms/unix_platform.rb +18 -39
- data/lib/aruba/platforms/unix_which.rb +3 -2
- data/lib/aruba/platforms/windows_command_string.rb +20 -7
- data/lib/aruba/platforms/windows_environment_variables.rb +42 -30
- data/lib/aruba/platforms/windows_platform.rb +4 -0
- data/lib/aruba/platforms/windows_which.rb +9 -4
- data/lib/aruba/processes/basic_process.rb +21 -27
- data/lib/aruba/processes/debug_process.rb +16 -5
- data/lib/aruba/processes/in_process.rb +20 -9
- data/lib/aruba/processes/spawn_process.rb +64 -36
- data/lib/aruba/rspec.rb +28 -31
- data/lib/aruba/runtime.rb +16 -7
- data/lib/aruba/setup.rb +32 -17
- data/lib/aruba/tasks/docker_helpers.rb +4 -2
- data/lib/aruba/version.rb +1 -1
- metadata +194 -64
- data/History.md +0 -612
- data/bin/bootstrap +0 -34
- data/bin/build +0 -3
- data/bin/release +0 -3
- data/fixtures/spawn_process/stderr.sh +0 -3
- data/lib/aruba/api/command.rb +0 -309
- data/lib/aruba/api/deprecated.rb +0 -895
- data/lib/aruba/api/rvm.rb +0 -44
- data/lib/aruba/config.rb +0 -101
- data/lib/aruba/cucumber/rvm.rb +0 -3
- data/lib/aruba/in_process.rb +0 -14
- data/lib/aruba/jruby.rb +0 -4
- data/lib/aruba/matchers/path/match_path_pattern.rb +0 -41
- data/lib/aruba/matchers/rspec_matcher_include_regexp.rb +0 -25
- data/lib/aruba/platforms/disk_usage_calculator.rb +0 -20
- data/lib/aruba/spawn_process.rb +0 -11
data/lib/aruba/cucumber/file.rb
CHANGED
@@ -3,11 +3,13 @@ Given(/^I use (?:a|the) fixture(?: named)? "([^"]*)"$/) do |name|
|
|
3
3
|
cd name
|
4
4
|
end
|
5
5
|
|
6
|
-
Given(/^I copy (?:a|the) (file|directory)(?: (?:named|from))? "([^"]*)" to "([^"]*)"$/)
|
6
|
+
Given(/^I copy (?:a|the) (?:file|directory)(?: (?:named|from))? "([^"]*)" to "([^"]*)"$/) \
|
7
|
+
do |source, destination|
|
7
8
|
copy source, destination
|
8
9
|
end
|
9
10
|
|
10
|
-
Given(/^I move (?:a|the) (file|directory)(?: (?:named|from))? "([^"]*)" to "([^"]*)"$/)
|
11
|
+
Given(/^I move (?:a|the) (?:file|directory)(?: (?:named|from))? "([^"]*)" to "([^"]*)"$/) \
|
12
|
+
do |source, destination|
|
11
13
|
move source, destination
|
12
14
|
end
|
13
15
|
|
@@ -15,7 +17,8 @@ Given(/^(?:a|the|(?:an empty)) directory(?: named)? "([^"]*)"$/) do |dir_name|
|
|
15
17
|
create_directory(dir_name)
|
16
18
|
end
|
17
19
|
|
18
|
-
Given(/^(?:a|the) directory(?: named)? "([^"]*)" with mode "([^"]*)"$/)
|
20
|
+
Given(/^(?:a|the) directory(?: named)? "([^"]*)" with mode "([^"]*)"$/) \
|
21
|
+
do |dir_name, dir_mode|
|
19
22
|
create_directory(dir_name)
|
20
23
|
chmod(dir_mode, dir_name)
|
21
24
|
end
|
@@ -32,7 +35,8 @@ Given(/^(?:a|the) file(?: named)? "([^"]*)" with "([^"]*)"$/) do |file_name, fil
|
|
32
35
|
write_file(file_name, unescape_text(file_content))
|
33
36
|
end
|
34
37
|
|
35
|
-
Given(/^(?:a|the) file(?: named)? "([^"]*)" with mode "([^"]*)" and with:$/)
|
38
|
+
Given(/^(?:a|the) file(?: named)? "([^"]*)" with mode "([^"]*)" and with:$/) \
|
39
|
+
do |file_name, file_mode, file_content|
|
36
40
|
write_file(file_name, unescape_text(file_content))
|
37
41
|
chmod(file_mode, file_name)
|
38
42
|
end
|
@@ -42,11 +46,12 @@ Given(/^(?:a|the) (\d+) byte file(?: named)? "([^"]*)"$/) do |file_size, file_na
|
|
42
46
|
end
|
43
47
|
|
44
48
|
Given(/^(?:an|the) empty file(?: named)? "([^"]*)"$/) do |file_name|
|
45
|
-
write_file(file_name,
|
49
|
+
write_file(file_name, '')
|
46
50
|
end
|
47
51
|
|
48
|
-
Given(/^(?:an|the) empty file(?: named)? "([^"]*)" with mode "([^"]*)"$/)
|
49
|
-
|
52
|
+
Given(/^(?:an|the) empty file(?: named)? "([^"]*)" with mode "([^"]*)"$/) \
|
53
|
+
do |file_name, file_mode|
|
54
|
+
write_file(file_name, '')
|
50
55
|
chmod(file_mode, file_name)
|
51
56
|
end
|
52
57
|
|
@@ -54,7 +59,8 @@ When(/^I write to "([^"]*)" with:$/) do |file_name, file_content|
|
|
54
59
|
write_file(file_name, file_content)
|
55
60
|
end
|
56
61
|
|
57
|
-
When(/^I overwrite(?: (?:a|the) file(?: named)?)? "([^"]*)" with:$/)
|
62
|
+
When(/^I overwrite(?: (?:a|the) file(?: named)?)? "([^"]*)" with:$/) \
|
63
|
+
do |file_name, file_content|
|
58
64
|
overwrite_file(file_name, file_content)
|
59
65
|
end
|
60
66
|
|
@@ -66,12 +72,13 @@ When(/^I append to "([^"]*)" with "([^"]*)"$/) do |file_name, file_content|
|
|
66
72
|
append_to_file(file_name, file_content)
|
67
73
|
end
|
68
74
|
|
69
|
-
When(/^I remove (?:a|the) (?:file|directory)(?: named)? "([^"]*)"( with full force)?$/)
|
70
|
-
|
75
|
+
When(/^I remove (?:a|the) (?:file|directory)(?: named)? "([^"]*)"( with full force)?$/) \
|
76
|
+
do |name, force_remove|
|
77
|
+
remove(name, force: force_remove.nil? ? false : true)
|
71
78
|
end
|
72
79
|
|
73
80
|
Given(/^(?:a|the) (?:file|directory)(?: named)? "([^"]*)" does not exist$/) do |name|
|
74
|
-
remove(name, :
|
81
|
+
remove(name, force: true)
|
75
82
|
end
|
76
83
|
|
77
84
|
When(/^I cd to "([^"]*)"$/) do |dir|
|
@@ -88,21 +95,21 @@ Then(/^the following files should (not )?exist:$/) do |negated, files|
|
|
88
95
|
end
|
89
96
|
end
|
90
97
|
|
91
|
-
Then(/^(?:a|the)
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
else
|
96
|
-
expect(path).to be_an_existing_file
|
97
|
-
end
|
98
|
-
elsif directory_or_file == 'directory'
|
99
|
-
if expect_match
|
100
|
-
expect(path).not_to be_an_existing_directory
|
101
|
-
else
|
102
|
-
expect(path).to be_an_existing_directory
|
103
|
-
end
|
98
|
+
Then(/^(?:a|the) file(?: named)? "([^"]*)" should (not )?exist(?: anymore)?$/) \
|
99
|
+
do |path, expect_match|
|
100
|
+
if expect_match
|
101
|
+
expect(path).not_to be_an_existing_file
|
104
102
|
else
|
105
|
-
|
103
|
+
expect(path).to be_an_existing_file
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
Then(/^(?:a|the) directory(?: named)? "([^"]*)" should (not )?exist(?: anymore)?$/) \
|
108
|
+
do |path, expect_match|
|
109
|
+
if expect_match
|
110
|
+
expect(path).not_to be_an_existing_directory
|
111
|
+
else
|
112
|
+
expect(path).to be_an_existing_directory
|
106
113
|
end
|
107
114
|
end
|
108
115
|
|
@@ -114,7 +121,8 @@ Then(/^(?:a|the) file matching %r<(.*?)> should (not )?exist$/) do |pattern, exp
|
|
114
121
|
end
|
115
122
|
end
|
116
123
|
|
117
|
-
Then(/^(?:a|the) (\d+) byte file(?: named)? "([^"]*)" should (not )?exist$/)
|
124
|
+
Then(/^(?:a|the) (\d+) byte file(?: named)? "([^"]*)" should (not )?exist$/) \
|
125
|
+
do |size, file, negated|
|
118
126
|
if negated
|
119
127
|
expect(file).not_to have_file_size(size)
|
120
128
|
else
|
@@ -132,7 +140,8 @@ Then(/^the following directories should (not )?exist:$/) do |negated, directorie
|
|
132
140
|
end
|
133
141
|
end
|
134
142
|
|
135
|
-
Then(/^(?:a|the) file(?: named)? "([^"]*)" should (not )?contain "([^"]*)"$/)
|
143
|
+
Then(/^(?:a|the) file(?: named)? "([^"]*)" should (not )?contain "([^"]*)"$/) \
|
144
|
+
do |file, negated, content|
|
136
145
|
if negated
|
137
146
|
expect(file).not_to have_file_content file_content_including(content.chomp)
|
138
147
|
else
|
@@ -140,7 +149,8 @@ Then(/^(?:a|the) file(?: named)? "([^"]*)" should (not )?contain "([^"]*)"$/) do
|
|
140
149
|
end
|
141
150
|
end
|
142
151
|
|
143
|
-
Then(/^(?:a|the) file(?: named)? "([^"]*)" should (not )?contain:$/)
|
152
|
+
Then(/^(?:a|the) file(?: named)? "([^"]*)" should (not )?contain:$/) \
|
153
|
+
do |file, negated, content|
|
144
154
|
if negated
|
145
155
|
expect(file).not_to have_file_content file_content_including(content.chomp)
|
146
156
|
else
|
@@ -148,7 +158,8 @@ Then(/^(?:a|the) file(?: named)? "([^"]*)" should (not )?contain:$/) do |file, n
|
|
148
158
|
end
|
149
159
|
end
|
150
160
|
|
151
|
-
Then(/^(?:a|the) file(?: named)? "([^"]*)" should (not )?contain exactly:$/)
|
161
|
+
Then(/^(?:a|the) file(?: named)? "([^"]*)" should (not )?contain exactly:$/) \
|
162
|
+
do |file, negated, content|
|
152
163
|
if negated
|
153
164
|
expect(file).not_to have_file_content content
|
154
165
|
else
|
@@ -156,7 +167,8 @@ Then(/^(?:a|the) file(?: named)? "([^"]*)" should (not )?contain exactly:$/) do
|
|
156
167
|
end
|
157
168
|
end
|
158
169
|
|
159
|
-
Then(/^(?:a|the) file(?: named)? "([^"]*)" should (not )?match %r<([
|
170
|
+
Then(/^(?:a|the) file(?: named)? "([^"]*)" should (not )?match %r<([^>]*)>$/) \
|
171
|
+
do |file, negated, content|
|
160
172
|
if negated
|
161
173
|
expect(file).not_to have_file_content file_content_matching(content)
|
162
174
|
else
|
@@ -164,7 +176,8 @@ Then(/^(?:a|the) file(?: named)? "([^"]*)" should (not )?match %r<([^\/]*)>$/) d
|
|
164
176
|
end
|
165
177
|
end
|
166
178
|
|
167
|
-
Then(
|
179
|
+
Then(%r{^(?:a|the) file(?: named)? "([^"]*)" should (not )?match /([^/]*)/$}) \
|
180
|
+
do |file, negated, content|
|
168
181
|
if negated
|
169
182
|
expect(file).not_to have_file_content file_content_matching(content)
|
170
183
|
else
|
@@ -172,30 +185,23 @@ Then(/^(?:a|the) file(?: named)? "([^"]*)" should (not )?match \/([^\/]*)\/$/) d
|
|
172
185
|
end
|
173
186
|
end
|
174
187
|
|
175
|
-
Then(/^(?:a|the) file(?: named)? "([^"]*)" should (not )?be equal to file "([^"]*)"/)
|
188
|
+
Then(/^(?:a|the) file(?: named)? "([^"]*)" should (not )?be equal to file "([^"]*)"/) \
|
189
|
+
do |file, negated, reference_file|
|
176
190
|
if negated
|
177
|
-
expect(file).not_to
|
191
|
+
expect(file).not_to have_same_file_content_as(reference_file)
|
178
192
|
else
|
179
|
-
expect(file).to
|
193
|
+
expect(file).to have_same_file_content_as(reference_file)
|
180
194
|
end
|
181
195
|
end
|
182
196
|
|
183
|
-
Then(
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
if negated
|
189
|
-
expect(file).not_to have_permissions(permissions)
|
190
|
-
else
|
191
|
-
expect(file).to have_permissions(permissions)
|
192
|
-
end
|
197
|
+
Then(
|
198
|
+
/^(?:a|the) (?:file|directory)(?: named)? "([^"]*)" should have permissions "([^"]*)"$/
|
199
|
+
) do |path, permissions|
|
200
|
+
expect(path).to have_permissions(permissions)
|
193
201
|
end
|
194
202
|
|
195
|
-
Then(
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
expect(path).to have_permissions(permissions)
|
200
|
-
end
|
203
|
+
Then(
|
204
|
+
/^(?:a|the) (?:file|directory)(?: named)? "([^"]*)" should not have permissions "([^"]*)"$/
|
205
|
+
) do |path, permissions|
|
206
|
+
expect(path).not_to have_permissions(permissions)
|
201
207
|
end
|
data/lib/aruba/cucumber/hooks.rb
CHANGED
@@ -3,24 +3,28 @@ require 'aruba/api'
|
|
3
3
|
require 'aruba/platform'
|
4
4
|
World(Aruba::Api)
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
with_environment(&block)
|
9
|
-
end
|
6
|
+
Around do |_, block|
|
7
|
+
with_environment(&block)
|
10
8
|
end
|
11
9
|
|
12
10
|
Before do
|
13
11
|
# ... so every change needs to be done later
|
14
|
-
prepend_environment_variable
|
12
|
+
prepend_environment_variable(
|
13
|
+
'PATH',
|
14
|
+
aruba.config.command_search_paths.join(File::PATH_SEPARATOR) + File::PATH_SEPARATOR
|
15
|
+
)
|
15
16
|
set_environment_variable 'HOME', aruba.config.home_directory
|
16
17
|
end
|
17
18
|
|
18
19
|
After do
|
19
|
-
restore_env
|
20
20
|
terminate_all_commands
|
21
21
|
aruba.command_monitor.clear
|
22
22
|
end
|
23
23
|
|
24
|
+
Before('@no-clobber') do
|
25
|
+
setup_aruba(false)
|
26
|
+
end
|
27
|
+
|
24
28
|
Before('~@no-clobber') do
|
25
29
|
setup_aruba
|
26
30
|
end
|
@@ -41,12 +45,6 @@ Before('@announce-command-filesystem-status') do
|
|
41
45
|
aruba.announcer.activate :command_filesystem_status
|
42
46
|
end
|
43
47
|
|
44
|
-
Before('@announce-cmd') do
|
45
|
-
Aruba.platform.deprecated 'The use of "@announce-cmd"-hook is deprecated. Please use "@announce-command"'
|
46
|
-
|
47
|
-
aruba.announcer.activate :command
|
48
|
-
end
|
49
|
-
|
50
48
|
Before('@announce-output') do
|
51
49
|
aruba.announcer.activate :stdout
|
52
50
|
aruba.announcer.activate :stderr
|
@@ -60,12 +58,6 @@ Before('@announce-stderr') do
|
|
60
58
|
aruba.announcer.activate :stderr
|
61
59
|
end
|
62
60
|
|
63
|
-
Before('@announce-dir') do
|
64
|
-
Aruba.platform.deprecated 'The use of "@announce-dir"-hook is deprecated. Please use "@announce-directory"'
|
65
|
-
|
66
|
-
aruba.announcer.activate :directory
|
67
|
-
end
|
68
|
-
|
69
61
|
Before('@announce-directory') do
|
70
62
|
aruba.announcer.activate :directory
|
71
63
|
end
|
@@ -74,28 +66,10 @@ Before('@announce-stop-signal') do
|
|
74
66
|
aruba.announcer.activate :stop_signal
|
75
67
|
end
|
76
68
|
|
77
|
-
Before('@announce-env') do
|
78
|
-
Aruba.platform.deprecated 'The use of "@announce-env"-hook is deprecated. Please use "@announce-changed-environment"'
|
79
|
-
|
80
|
-
aruba.announcer.activate :environment
|
81
|
-
end
|
82
|
-
|
83
|
-
Before('@announce-environment') do
|
84
|
-
Aruba.platform.deprecated '@announce-environment is deprecated. Use @announce-changed-environment instead'
|
85
|
-
|
86
|
-
aruba.announcer.activate :changed_environment
|
87
|
-
end
|
88
|
-
|
89
69
|
Before('@announce-full-environment') do
|
90
70
|
aruba.announcer.activate :full_environment
|
91
71
|
end
|
92
72
|
|
93
|
-
Before('@announce-modified-environment') do
|
94
|
-
Aruba.platform.deprecated '@announce-modified-environment is deprecated. Use @announce-changed-environment instead'
|
95
|
-
|
96
|
-
aruba.announcer.activate :changed_environment
|
97
|
-
end
|
98
|
-
|
99
73
|
Before('@announce-changed-environment') do
|
100
74
|
aruba.announcer.activate :changed_environment
|
101
75
|
end
|
@@ -124,23 +98,8 @@ Before('@announce') do
|
|
124
98
|
aruba.announcer.activate :command_filesystem_status
|
125
99
|
end
|
126
100
|
|
127
|
-
Before('@ansi') do
|
128
|
-
# rubocop:disable Metrics/LineLength
|
129
|
-
Aruba::Platform.deprecated('The use of "@ansi" is deprecated. Use "@keep-ansi-escape-sequences" instead. But be aware, that this hook uses the aruba configuration and not an instance variable')
|
130
|
-
# rubocop:enable Metrics/LineLength
|
131
|
-
|
132
|
-
aruba.config.remove_ansi_escape_sequences = false
|
133
|
-
end
|
134
|
-
|
135
101
|
Before('@keep-ansi-escape-sequences') do
|
136
102
|
aruba.config.remove_ansi_escape_sequences = false
|
137
|
-
aruba.config.keep_ansi = true
|
138
|
-
end
|
139
|
-
|
140
|
-
Before '@mocked_home_directory' do
|
141
|
-
Aruba.platform.deprecated('The use of "@mocked_home_directory" is deprecated. Use "@mocked-home-directory" instead')
|
142
|
-
|
143
|
-
set_environment_variable 'HOME', expand_path('.')
|
144
103
|
end
|
145
104
|
|
146
105
|
Before '@mocked-home-directory' do
|
@@ -151,18 +110,6 @@ Before('@disable-bundler') do
|
|
151
110
|
unset_bundler_env_vars
|
152
111
|
end
|
153
112
|
|
154
|
-
Before('@spawn') do
|
155
|
-
Aruba.platform.deprecated('The use of "@spawn" is deprecated. Use "@command-launcher-spawn" instead')
|
156
|
-
|
157
|
-
aruba.config.command_launcher = :spawn
|
158
|
-
end
|
159
|
-
|
160
|
-
Before('@in_process') do
|
161
|
-
Aruba.platform.deprecated('The use of "@in_process" is deprecated. Use "@command-launcher-in-process" instead')
|
162
|
-
|
163
|
-
aruba.config.command_launcher = :in_process
|
164
|
-
end
|
165
|
-
|
166
113
|
Before('@debug') do
|
167
114
|
aruba.config.command_launcher = :debug
|
168
115
|
end
|
@@ -1,25 +1,33 @@
|
|
1
1
|
# Cucumber
|
2
|
-
Then
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
2
|
+
Then(/^the feature(?:s)? should not(?: all)? pass$/) do
|
3
|
+
step 'the output should contain " failed)"'
|
4
|
+
step 'the exit status should be 1'
|
5
|
+
end
|
6
|
+
|
7
|
+
# Cucumber
|
8
|
+
Then(/^the feature(?:s)? should(?: all)? pass$/) do
|
9
|
+
step 'the output should not contain " failed)"'
|
10
|
+
step 'the output should not contain " undefined)"'
|
11
|
+
step 'the exit status should be 0'
|
11
12
|
end
|
12
13
|
|
13
14
|
# Cucumber
|
14
|
-
Then
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
Then(/^the feature(?:s)? should not(?: all)? pass with( regex)?:$/) do |regex, string|
|
16
|
+
step 'the output should contain " failed)"'
|
17
|
+
step 'the exit status should be 1'
|
18
|
+
|
19
|
+
if regex
|
20
|
+
step "the output should match %r<#{string}>"
|
18
21
|
else
|
19
|
-
step 'the output should
|
20
|
-
step 'the output should not contain " undefined)"'
|
21
|
-
step 'the exit status should be 0'
|
22
|
+
step 'the output should contain:', string
|
22
23
|
end
|
24
|
+
end
|
25
|
+
|
26
|
+
# Cucumber
|
27
|
+
Then(/^the feature(?:s)? should(?: all)? pass with( regex)?:$/) do |regex, string|
|
28
|
+
step 'the output should not contain " failed)"'
|
29
|
+
step 'the output should not contain " undefined)"'
|
30
|
+
step 'the exit status should be 0'
|
23
31
|
|
24
32
|
if regex
|
25
33
|
step "the output should match %r<#{string}>"
|
@@ -29,30 +37,39 @@ Then /^the feature(?:s)? should( not)?(?: all)? pass with( regex)?:$/ do |negate
|
|
29
37
|
end
|
30
38
|
|
31
39
|
# RSpec
|
32
|
-
Then
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
else
|
37
|
-
step %(the output should contain "#{count_failures} failures")
|
38
|
-
end
|
39
|
-
|
40
|
-
step 'the exit status should be 1'
|
40
|
+
Then(/^the spec(?:s)? should not(?: all)? pass(?: with (\d+) failures?)?$/) \
|
41
|
+
do |count_failures|
|
42
|
+
if count_failures.nil?
|
43
|
+
step 'the output should not contain "0 failures"'
|
41
44
|
else
|
42
|
-
step
|
43
|
-
step 'the exit status should be 0'
|
45
|
+
step %(the output should contain "#{count_failures} failures")
|
44
46
|
end
|
47
|
+
|
48
|
+
step 'the exit status should be 1'
|
45
49
|
end
|
46
50
|
|
47
51
|
# RSpec
|
48
|
-
Then
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
+
Then(/^the spec(?:s)? should all pass$/) do
|
53
|
+
step 'the output should contain "0 failures"'
|
54
|
+
step 'the exit status should be 0'
|
55
|
+
end
|
56
|
+
|
57
|
+
# RSpec
|
58
|
+
Then(/^the spec(?:s)? should not(?: all)? pass with( regex)?:$/) do |regex, string|
|
59
|
+
step 'the output should not contain "0 failures"'
|
60
|
+
step 'the exit status should be 1'
|
61
|
+
|
62
|
+
if regex
|
63
|
+
step "the output should match %r<#{string}>"
|
52
64
|
else
|
53
|
-
step 'the output should contain
|
54
|
-
step 'the exit status should be 0'
|
65
|
+
step 'the output should contain:', string
|
55
66
|
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# RSpec
|
70
|
+
Then(/^the spec(?:s)? should(?: all)? pass with( regex)?:$/) do |regex, string|
|
71
|
+
step 'the output should contain "0 failures"'
|
72
|
+
step 'the exit status should be 0'
|
56
73
|
|
57
74
|
if regex
|
58
75
|
step "the output should match %r<#{string}>"
|
@@ -62,30 +79,39 @@ Then /^the spec(?:s)? should( not)?(?: all)? pass with( regex)?:$/ do |negated,
|
|
62
79
|
end
|
63
80
|
|
64
81
|
# Minitest
|
65
|
-
Then
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
else
|
70
|
-
step %(the output should contain "#{count_failures} errors")
|
71
|
-
end
|
72
|
-
|
73
|
-
step 'the exit status should be 1'
|
82
|
+
Then(/^the tests(?:s)? should not(?: all)? pass(?: with (\d+) failures?)?$/) \
|
83
|
+
do |count_failures|
|
84
|
+
if count_failures.nil?
|
85
|
+
step 'the output should not contain "0 errors"'
|
74
86
|
else
|
75
|
-
step
|
76
|
-
step 'the exit status should be 0'
|
87
|
+
step %(the output should contain "#{count_failures} errors")
|
77
88
|
end
|
89
|
+
|
90
|
+
step 'the exit status should be 1'
|
78
91
|
end
|
79
92
|
|
80
93
|
# Minitest
|
81
|
-
Then
|
82
|
-
|
83
|
-
|
84
|
-
|
94
|
+
Then(/^the tests(?:s)? should all pass$/) do
|
95
|
+
step 'the output should contain "0 errors"'
|
96
|
+
step 'the exit status should be 0'
|
97
|
+
end
|
98
|
+
|
99
|
+
# Minitest
|
100
|
+
Then(/^the test(?:s)? should not(?: all)? pass with( regex)?:$/) do |regex, string|
|
101
|
+
step 'the output should contain "0 errors"'
|
102
|
+
step 'the exit status should be 1'
|
103
|
+
|
104
|
+
if regex
|
105
|
+
step "the output should match %r<#{string}>"
|
85
106
|
else
|
86
|
-
step 'the output should
|
87
|
-
step 'the exit status should be 0'
|
107
|
+
step 'the output should contain:', string
|
88
108
|
end
|
109
|
+
end
|
110
|
+
|
111
|
+
# Minitest
|
112
|
+
Then(/^the test(?:s)? should(?: all)? pass with( regex)?:$/) do |regex, string|
|
113
|
+
step 'the output should not contain "0 errors"'
|
114
|
+
step 'the exit status should be 0'
|
89
115
|
|
90
116
|
if regex
|
91
117
|
step "the output should match %r<#{string}>"
|