aruba 2.4.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +87 -7
  3. data/CONTRIBUTING.md +55 -33
  4. data/README.md +11 -9
  5. data/lib/aruba/api/bundler.rb +1 -5
  6. data/lib/aruba/api/commands.rb +29 -40
  7. data/lib/aruba/api/core.rb +2 -13
  8. data/lib/aruba/api/filesystem.rb +24 -44
  9. data/lib/aruba/api/text.rb +5 -2
  10. data/lib/aruba/aruba_logger.rb +3 -6
  11. data/lib/aruba/basic_configuration/option.rb +1 -7
  12. data/lib/aruba/basic_configuration.rb +7 -13
  13. data/lib/aruba/cli.rb +0 -6
  14. data/lib/aruba/command.rb +16 -16
  15. data/lib/aruba/command_monitor.rb +2 -4
  16. data/lib/aruba/configuration.rb +32 -20
  17. data/lib/aruba/cucumber/command.rb +32 -119
  18. data/lib/aruba/cucumber/environment.rb +0 -4
  19. data/lib/aruba/cucumber/file.rb +10 -10
  20. data/lib/aruba/cucumber/hooks.rb +12 -15
  21. data/lib/aruba/cucumber.rb +0 -1
  22. data/lib/aruba/events.rb +50 -14
  23. data/lib/aruba/generators/script_file.rb +5 -5
  24. data/lib/aruba/initializer.rb +7 -2
  25. data/lib/aruba/matchers/command/have_output.rb +1 -1
  26. data/lib/aruba/matchers/command/have_output_on_stderr.rb +1 -1
  27. data/lib/aruba/matchers/command/have_output_on_stdout.rb +1 -1
  28. data/lib/aruba/matchers/command/have_output_size.rb +7 -20
  29. data/lib/aruba/matchers/string/match_output_string.rb +0 -2
  30. data/lib/aruba/platforms/unix_platform.rb +3 -3
  31. data/lib/aruba/platforms/unix_which.rb +2 -4
  32. data/lib/aruba/platforms/windows_which.rb +2 -4
  33. data/lib/aruba/processes/basic_process.rb +4 -4
  34. data/lib/aruba/processes/debug_process.rb +2 -1
  35. data/lib/aruba/processes/in_process.rb +3 -1
  36. data/lib/aruba/processes/spawn_process.rb +32 -21
  37. data/lib/aruba/rspec.rb +18 -25
  38. data/lib/aruba/runtime.rb +39 -21
  39. data/lib/aruba/setup.rb +20 -21
  40. data/lib/aruba/version.rb +1 -1
  41. metadata +76 -63
  42. data/lib/aruba/console/help.rb +0 -34
  43. data/lib/aruba/console.rb +0 -67
  44. data/lib/aruba/contracts/absolute_path.rb +0 -22
  45. data/lib/aruba/contracts/enum.rb +0 -29
  46. data/lib/aruba/contracts/is_power_of_two.rb +0 -24
  47. data/lib/aruba/contracts/relative_path.rb +0 -22
  48. data/lib/aruba/cucumber/testing_frameworks.rb +0 -219
  49. data/lib/aruba/matchers/string/include_output_string.rb +0 -36
  50. data/lib/aruba/matchers/string/output_string_eq.rb +0 -35
@@ -1,219 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- #
4
- # Cucumber
5
- #
6
- # This defines the following steps:
7
- #
8
- # 1. Simple pass/not pass/fail
9
- # 2. Pass/not pass/fail with a multiline string or regex
10
- #
11
- # For item 2, the 'not pass' variant is deprecated because the wording makes it
12
- # unclear how the negation should be applied.
13
- #
14
- Then(/^the feature(?:s)? should fail$/) do
15
- expect(all_output).to include_output_string ' failed)'
16
- expect(last_command_stopped).to have_exit_status 1
17
- end
18
-
19
- Then(/^the feature(?:s)? should not(?: all)? pass$/) do
20
- expect(all_output).to include_output_string ' failed)'
21
- expect(last_command_stopped).to have_exit_status 1
22
- end
23
-
24
- Then(/^the feature(?:s)? should(?: all)? pass$/) do
25
- expect(all_output).not_to include_output_string ' failed)'
26
- expect(all_output).not_to include_output_string ' undefined)'
27
- expect(last_command_stopped).to have_exit_status 0
28
- end
29
-
30
- Then(/^the feature(?:s)? should fail with( regex)?:$/) do |regex, string|
31
- expect(all_output).to include_output_string ' failed)'
32
- expect(last_command_stopped).to have_exit_status 1
33
-
34
- if regex
35
- expect(all_output).to match_output_string(string)
36
- else
37
- expect(all_output).to include_output_string(string)
38
- end
39
- end
40
-
41
- Then(/^the feature(?:s)? should not(?: all)? pass with( regex)?:$/) do |regex, string|
42
- Aruba.platform.deprecated \
43
- 'This cucumber step has confusing wording and is deprecated.' \
44
- "Use 'the feature(s) should fail with#{regex}:' instead."
45
- expect(all_output).to include_output_string ' failed)'
46
- expect(last_command_stopped).to have_exit_status 1
47
-
48
- if regex
49
- expect(all_output).to match_output_string(string)
50
- else
51
- expect(all_output).to include_output_string(string)
52
- end
53
- end
54
-
55
- Then(/^the feature(?:s)? should(?: all)? pass with( regex)?:$/) do |regex, string|
56
- expect(all_output).not_to include_output_string ' failed)'
57
- expect(all_output).not_to include_output_string ' undefined)'
58
- expect(last_command_stopped).to have_exit_status 0
59
-
60
- if regex
61
- expect(all_output).to match_output_string(string)
62
- else
63
- expect(all_output).to include_output_string(string)
64
- end
65
- end
66
-
67
- #
68
- # RSpec
69
- #
70
- # This defines the following steps:
71
- #
72
- # 1. Simple pass/not pass/fail
73
- # 2. Not pass/fail with a failure count
74
- # 3. Pass/not pass/fail with a multiline string or regex
75
- #
76
- # For items 2 and 3, the 'not pass' variant is deprecated because the wording
77
- # makes it unclear how the negation should be applied.
78
- #
79
- Then(/^the spec(?:s)? should fail$/) do
80
- expect(all_output).not_to include_output_string '0 failures'
81
- expect(last_command_stopped).to have_exit_status 1
82
- end
83
-
84
- Then(/^the spec(?:s)? should not(?: all)? pass$/) do
85
- expect(all_output).not_to include_output_string '0 failures'
86
- expect(last_command_stopped).to have_exit_status 1
87
- end
88
-
89
- Then(/^the spec(?:s)? should(?: all)? pass$/) do
90
- expect(all_output).to include_output_string '0 failures'
91
- expect(last_command_stopped).to have_exit_status 0
92
- end
93
-
94
- Then(/^the spec(?:s)? should fail with (\d+) failures?$/) do |count|
95
- expect(all_output).to include_output_string "#{count} failures"
96
-
97
- expect(last_command_stopped).to have_exit_status 1
98
- end
99
-
100
- Then(/^the spec(?:s)? should not(?: all)? pass with (\d+) failures?$/) do |count|
101
- Aruba.platform.deprecated \
102
- 'This rspec step has confusing wording and is deprecated.' \
103
- "Use 'the spec(s) should fail with #{count} failures' instead."
104
- expect(all_output).to include_output_string "#{count} failures"
105
-
106
- expect(last_command_stopped).to have_exit_status 1
107
- end
108
-
109
- Then(/^the spec(?:s)? should fail with( regex)?:$/) do |regex, string|
110
- expect(all_output).not_to include_output_string '0 failures'
111
- expect(last_command_stopped).to have_exit_status 1
112
-
113
- if regex
114
- expect(all_output).to match_output_string(string)
115
- else
116
- expect(all_output).to include_output_string(string)
117
- end
118
- end
119
-
120
- Then(/^the spec(?:s)? should not(?: all)? pass with( regex)?:$/) do |regex, string|
121
- Aruba.platform.deprecated \
122
- 'This rspec step has confusing wording and is deprecated.' \
123
- "Use 'the spec(s) should fail with#{regex}:' instead."
124
- expect(all_output).not_to include_output_string '0 failures'
125
- expect(last_command_stopped).to have_exit_status 1
126
-
127
- if regex
128
- expect(all_output).to match_output_string(string)
129
- else
130
- expect(all_output).to include_output_string(string)
131
- end
132
- end
133
-
134
- Then(/^the spec(?:s)? should(?: all)? pass with( regex)?:$/) do |regex, string|
135
- expect(all_output).to include_output_string '0 failures'
136
- expect(last_command_stopped).to have_exit_status 0
137
-
138
- if regex
139
- expect(all_output).to match_output_string(string)
140
- else
141
- expect(all_output).to include_output_string(string)
142
- end
143
- end
144
-
145
- #
146
- # Minitest
147
- #
148
- # This defines the following steps:
149
- #
150
- # 1. Simple pass/not pass/fail
151
- # 2. Not pass/fail with a failure count
152
- # 3. Pass/not pass/fail with a multiline string or regex
153
- #
154
- # For items 2 and 3, the 'not pass' variant is deprecated because the wording
155
- # makes it unclear how the negation should be applied.
156
- #
157
- Then(/^the test(?:s)? should fail$/) do
158
- expect(all_output).not_to include_output_string '0 errors'
159
- expect(last_command_stopped).to have_exit_status 1
160
- end
161
-
162
- Then(/^the tests(?:s)? should not(?: all)? pass$/) do
163
- expect(all_output).not_to include_output_string '0 errors'
164
- expect(last_command_stopped).to have_exit_status 1
165
- end
166
-
167
- Then(/^the tests(?:s)? should(?: all)? pass$/) do
168
- expect(all_output).to include_output_string '0 errors'
169
- expect(last_command_stopped).to have_exit_status 0
170
- end
171
-
172
- Then(/^the test(?:s)? should fail with (\d+) errors?$/) do |count|
173
- expect(all_output).to include_output_string "#{count} errors"
174
- expect(last_command_stopped).to have_exit_status 1
175
- end
176
-
177
- Then(/^the tests(?:s)? should not(?: all)? pass with (\d+) failures?$/) do |count|
178
- Aruba.platform.deprecated \
179
- 'This minitest step has confusing wording and is deprecated.' \
180
- "Use 'the test(s) should fail #{count} errors' instead."
181
- expect(all_output).to include_output_string "#{count} errors"
182
- expect(last_command_stopped).to have_exit_status 1
183
- end
184
-
185
- Then(/^the test(?:s)? should fail with( regex)?:$/) do |regex, string|
186
- expect(all_output).not_to include_output_string '0 errors'
187
- expect(last_command_stopped).to have_exit_status 1
188
-
189
- if regex
190
- expect(all_output).to match_output_string(string)
191
- else
192
- expect(all_output).to include_output_string(string)
193
- end
194
- end
195
-
196
- Then(/^the test(?:s)? should not(?: all)? pass with( regex)?:$/) do |regex, string|
197
- Aruba.platform.deprecated \
198
- 'This minitest step has confusing wording and is deprecated.' \
199
- "Use 'the test(s) should fail with#{regex}:' instead."
200
- expect(all_output).not_to include_output_string '0 errors'
201
- expect(last_command_stopped).to have_exit_status 1
202
-
203
- if regex
204
- expect(all_output).to match_output_string(string)
205
- else
206
- expect(all_output).to include_output_string(string)
207
- end
208
- end
209
-
210
- Then(/^the test(?:s)? should(?: all)? pass with( regex)?:$/) do |regex, string|
211
- expect(all_output).not_to include_output_string '0 errors'
212
- expect(last_command_stopped).to have_exit_status 0
213
-
214
- if regex
215
- expect(all_output).to match_output_string(string)
216
- else
217
- expect(all_output).to include_output_string(string)
218
- end
219
- end
@@ -1,36 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # @!method include_output_string(string)
4
- # This matchers checks if the output string of a command includes string.
5
- #
6
- # @param [String] string
7
- # The value of the output string
8
- #
9
- # @return [Boolean] The result
10
- #
11
- # False:
12
- # * if the output string does not include string
13
- # True:
14
- # * if the output string includes string
15
- #
16
- # @example Use matcher
17
- # RSpec.describe do
18
- # it { expect(last_command_started).to have_output an_output_string_including string) }
19
- # it { expect(last_command_started).to have_output include_output_string string) }
20
- # end
21
- RSpec::Matchers.define :include_output_string do |expected|
22
- match do |actual|
23
- actual.force_encoding('UTF-8')
24
- @expected = Regexp.new(Regexp.escape(sanitize_text(expected.to_s)), Regexp::MULTILINE)
25
- @actual = sanitize_text(actual)
26
-
27
- values_match? @expected, @actual
28
- end
29
-
30
- diffable
31
-
32
- description { "string includes: #{description_of expected}" }
33
- end
34
-
35
- RSpec::Matchers.alias_matcher :an_output_string_including, :include_output_string
36
- RSpec::Matchers.alias_matcher :file_content_including, :include_output_string
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # @!method output_string_eq(string)
4
- # This matchers checks if the output string of a command includes string.
5
- #
6
- # @param [String] string
7
- # The value of the output string
8
- #
9
- # @return [Boolean]
10
- #
11
- # False:
12
- # * if the output string does not include string
13
- # True:
14
- # * if the output string includes string
15
- #
16
- # @example Use matcher
17
- # RSpec.describe do
18
- # it { expect(last_command_started).to have_output output_string_eq string) }
19
- # it { expect(last_command_started).to have_output an_output_string_begin_eq string) }
20
- # end
21
- RSpec::Matchers.define :output_string_eq do |expected|
22
- match do |actual|
23
- actual.force_encoding('UTF-8')
24
- @expected = sanitize_text(expected.to_s)
25
- @actual = sanitize_text(actual.to_s)
26
-
27
- values_match? @expected, @actual
28
- end
29
-
30
- diffable
31
-
32
- description { "output string is eq: #{description_of expected}" }
33
- end
34
-
35
- RSpec::Matchers.alias_matcher :an_output_string_being_eq, :output_string_eq