aruba 1.1.1 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +61 -3
  3. data/CONTRIBUTING.md +9 -2
  4. data/README.md +21 -18
  5. data/lib/aruba/api/bundler.rb +1 -0
  6. data/lib/aruba/api/commands.rb +0 -2
  7. data/lib/aruba/api/core.rb +15 -11
  8. data/lib/aruba/api/filesystem.rb +1 -7
  9. data/lib/aruba/api/text.rb +0 -12
  10. data/lib/aruba/console.rb +1 -1
  11. data/lib/aruba/contracts/enum.rb +1 -0
  12. data/lib/aruba/cucumber/command.rb +175 -119
  13. data/lib/aruba/cucumber/file.rb +2 -2
  14. data/lib/aruba/cucumber/parameter_types.rb +1 -0
  15. data/lib/aruba/cucumber.rb +1 -0
  16. data/lib/aruba/event_bus/name_resolver.rb +1 -1
  17. data/lib/aruba/matchers/command/be_successfully_executed.rb +0 -2
  18. data/lib/aruba/matchers/command/have_exit_status.rb +7 -13
  19. data/lib/aruba/matchers/command/have_finished_in_time.rb +0 -2
  20. data/lib/aruba/matchers/directory/be_an_existing_directory.rb +0 -2
  21. data/lib/aruba/matchers/directory/have_sub_directory.rb +0 -2
  22. data/lib/aruba/matchers/file/be_a_command_found_in_path.rb +0 -2
  23. data/lib/aruba/matchers/file/be_an_existing_executable.rb +0 -1
  24. data/lib/aruba/matchers/file/be_an_existing_file.rb +0 -2
  25. data/lib/aruba/matchers/file/have_file_content.rb +0 -2
  26. data/lib/aruba/matchers/file/have_file_size.rb +0 -2
  27. data/lib/aruba/matchers/file/have_same_file_content.rb +0 -1
  28. data/lib/aruba/matchers/path/a_path_matching_pattern.rb +0 -2
  29. data/lib/aruba/matchers/path/be_an_absolute_path.rb +0 -2
  30. data/lib/aruba/matchers/path/be_an_existing_path.rb +0 -2
  31. data/lib/aruba/matchers/path/have_permissions.rb +0 -2
  32. data/lib/aruba/platform.rb +2 -2
  33. data/lib/aruba/platforms/announcer.rb +0 -2
  34. data/lib/aruba/platforms/command_monitor.rb +2 -2
  35. data/lib/aruba/platforms/unix_environment_variables.rb +0 -2
  36. data/lib/aruba/platforms/unix_platform.rb +2 -1
  37. data/lib/aruba/platforms/windows_environment_variables.rb +1 -1
  38. data/lib/aruba/platforms/windows_platform.rb +1 -3
  39. data/lib/aruba/platforms/windows_which.rb +1 -1
  40. data/lib/aruba/processes/basic_process.rb +4 -0
  41. data/lib/aruba/version.rb +1 -1
  42. metadata +82 -26
  43. data/lib/aruba/matchers/base/base_matcher.rb +0 -87
  44. data/lib/aruba/matchers/base/object_formatter.rb +0 -104
  45. data/lib/aruba/matchers/collection/all.rb +0 -11
  46. data/lib/aruba/matchers/collection/include_an_object.rb +0 -120
  47. data/lib/aruba/matchers/collection.rb +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 447c91b46467e32b757f7ec3edeaacd9ef1f9e5de47d9df4739fffbabee9bb6c
4
- data.tar.gz: bdd36a4d52ada46fab83ae3d8647f93a8c5526431572c3a627e5feea072b65d0
3
+ metadata.gz: bc48eb26abb5d1e638537ed9eaf53f5758c541ca48e9f979da107bb8a7bdcf6c
4
+ data.tar.gz: 75d8cc6d3c52b62538f688949ee212abd5c3dad8aca20fd3007860757eaf830e
5
5
  SHA512:
6
- metadata.gz: ab49be0c20ad8e3ec29df0bad0a1f40403f4a7fbd660e6c820b285279f5766ff6f5b964b2b82b01493b047c5a7dd62b4302b0a74a1663911f299ab3c7b3deb03
7
- data.tar.gz: 8e6982a29ba7e6b3abf1c1a74e2701b901672a13278ddae8b6a108abbfbeb88782e99c4e512c82aee4be7630471307b30c8fe581b18ee0e7386320e7c0c60f11
6
+ metadata.gz: bece1031dfa68f1fa9a80854758558596cc48d073996fb5d3f6440226d18e68c7408d478ffa6a9f7881aa52e3d172c1acaa1bf3bae5948b07af363e6a456c75d
7
+ data.tar.gz: 7f68b65140bbe200235a6e23aac68a5f4da28ca9cf47171cd28d758a2b70aaa5645b7a45f739a1fa803d5c5770864196224d4797685c0de40328a71db7697d90
data/CHANGELOG.md CHANGED
@@ -6,7 +6,34 @@ This project adheres to [Semantic Versioning][1].
6
6
 
7
7
  This document is formatted according to the principles of [Keep A CHANGELOG][2].
8
8
 
9
- ## [Unreleased]
9
+ ## [2.0.1] / 2022-04-22
10
+
11
+ * Various cleanups of internal APIs ([#838] by [mvz])
12
+ * Make objects not pretend to be nil ([#843] by [mvz])
13
+ * Remove experimental variables replacement feature ([#846] by [mvz])
14
+ * Support Ruby 3.1 ([#850] by [mvz])
15
+ * Fix steps that wait for output from commands ([#856] by [mvz])
16
+ * Ensure `Gem.win_platform?` is available ([#858] by [mvz])
17
+ * Support JRuby 9.3 ([#867] by [mvz])
18
+
19
+ ## [2.0.0] / 2021-07-26
20
+
21
+ Potentially breaking changes:
22
+
23
+ * Bump miminum cucumber version to 4 ([#814] by [mvz])
24
+ * Drop support for Ruby 2.4 ([#820] by [mvz])
25
+ * Remove deprecated ability to append to non-existent file ([#829] by [mvz])
26
+ * Make absolute file name warning an error ([#783] by [mvz])
27
+
28
+ Other changes
29
+
30
+ * Use Ruby's built-in windows platform detection ([#813] by [mvz])
31
+ * Update some step definitions to use Cucumber Expression syntax ([#822] by [mvz])
32
+ * Update cucumber dependency to allow use of cucumber 7 ([#828] by [dependabot])
33
+
34
+ ## [1.1.2] / 2021-06-20
35
+
36
+ * Add Bundler as an explicit runtime dependency ([#810] by [luke-hill])
10
37
 
11
38
  ## [1.1.1] / 2021-05-14
12
39
 
@@ -977,8 +1004,36 @@ Note: These are changes w.r.t. Aruba version 0.14.1.
977
1004
 
978
1005
  <!-- issues & pull requests -->
979
1006
 
1007
+ [#867]: https://github.com/cucumber/aruba/pull/867
1008
+ [#858]: https://github.com/cucumber/aruba/pull/858
1009
+ [#856]: https://github.com/cucumber/aruba/pull/856
1010
+ [#850]: https://github.com/cucumber/aruba/pull/850
1011
+ [#846]: https://github.com/cucumber/aruba/pull/846
1012
+ [#843]: https://github.com/cucumber/aruba/pull/843
1013
+ [#838]: https://github.com/cucumber/aruba/pull/838
1014
+ [#829]: https://github.com/cucumber/aruba/pull/829
1015
+ [#828]: https://github.com/cucumber/aruba/pull/828
1016
+ [#822]: https://github.com/cucumber/aruba/pull/822
1017
+ [#820]: https://github.com/cucumber/aruba/pull/820
1018
+ [#814]: https://github.com/cucumber/aruba/pull/814
1019
+ [#813]: https://github.com/cucumber/aruba/pull/813
1020
+ [#810]: https://github.com/cucumber/aruba/pull/810
980
1021
  [#804]: https://github.com/cucumber/aruba/pull/804
981
1022
  [#801]: https://github.com/cucumber/aruba/pull/801
1023
+ [#783]: https://github.com/cucumber/aruba/pull/783
1024
+ [#781]: https://github.com/cucumber/aruba/pull/781
1025
+ [#780]: https://github.com/cucumber/aruba/pull/780
1026
+ [#772]: https://github.com/cucumber/aruba/pull/772
1027
+ [#771]: https://github.com/cucumber/aruba/pull/771
1028
+ [#769]: https://github.com/cucumber/aruba/pull/769
1029
+ [#767]: https://github.com/cucumber/aruba/pull/767
1030
+ [#766]: https://github.com/cucumber/aruba/pull/766
1031
+ [#763]: https://github.com/cucumber/aruba/pull/763
1032
+ [#751]: https://github.com/cucumber/aruba/pull/751
1033
+ [#750]: https://github.com/cucumber/aruba/pull/750
1034
+ [#748]: https://github.com/cucumber/aruba/pull/748
1035
+ [#738]: https://github.com/cucumber/aruba/pull/738
1036
+ [#737]: https://github.com/cucumber/aruba/pull/737
982
1037
  [#727]: https://github.com/cucumber/aruba/pull/727
983
1038
  [#725]: https://github.com/cucumber/aruba/pull/725
984
1039
  [#724]: https://github.com/cucumber/aruba/pull/724
@@ -1257,7 +1312,10 @@ Note: These are changes w.r.t. Aruba version 0.14.1.
1257
1312
 
1258
1313
  <!-- Releases -->
1259
1314
 
1260
- [Unreleased]: https://github.com/cucumber/aruba/compare/v1.1.1...main
1315
+ [Unreleased]: https://github.com/cucumber/aruba/compare/v2.0.1...main
1316
+ [2.0.1]: https://github.com/cucumber/aruba/compare/v2.0.0...v2.0.1
1317
+ [2.0.0]: https://github.com/cucumber/aruba/compare/v1.1.2...v2.0.0
1318
+ [1.1.2]: https://github.com/cucumber/aruba/compare/v1.1.1...v1.1.2
1261
1319
  [1.1.1]: https://github.com/cucumber/aruba/compare/v1.1.0...v1.1.1
1262
1320
  [1.1.0]: https://github.com/cucumber/aruba/compare/v1.0.4...v1.1.0
1263
1321
  [1.0.4]: https://github.com/cucumber/aruba/compare/v1.0.3...v1.0.4
@@ -1364,4 +1422,4 @@ Note: These are changes w.r.t. Aruba version 0.14.1.
1364
1422
 
1365
1423
  [1]: http://semver.org
1366
1424
  [2]: http://keepachangelog.com
1367
- [3]: https://github.com/cucumber/aruba/blob/master/CONTRIBUTING.md
1425
+ [3]: https://github.com/cucumber/aruba/blob/main/CONTRIBUTING.md
data/CONTRIBUTING.md CHANGED
@@ -73,7 +73,7 @@ Please...
73
73
 
74
74
  * Use pull requests for larger or controversial changes made by yourself or
75
75
  changes you might expected to break the build.
76
- * Commit smaller changes directly to master, e.g. fixing typos, adding tests or
76
+ * Commit smaller changes directly to `main`, e.g. fixing typos, adding tests or
77
77
  adding documentation.
78
78
  * Update [`CHANGELOG.md`][] when a pull request is merged.
79
79
  * Make sure all tests are green before merging a pull request.
@@ -145,6 +145,14 @@ docker run -v $PWD:/aruba --rm -it test-aruba:latest bash
145
145
  bundle exec rake
146
146
  ```
147
147
 
148
+ If you want to run the test suite against specific versions of Aruba's
149
+ dependencies, you can use [appraisal](https://github.com/thoughtbot/appraisal):
150
+
151
+ ```bash
152
+ bundle exec appraisal cucumber_6 bundle install
153
+ bundle exec appraisal cucumber_6 bundle exec rake
154
+ ```
155
+
148
156
  ### Installing your own gems used for development
149
157
 
150
158
  A `Gemfile.local` file can be used, to have your own gems installed to support
@@ -153,7 +161,6 @@ your normal development workflow.
153
161
  Example `Gemfile.local`:
154
162
 
155
163
  ```ruby
156
- gem 'pry'
157
164
  gem 'pry-byebug'
158
165
  gem 'byebug'
159
166
  ```
data/README.md CHANGED
@@ -1,11 +1,7 @@
1
- [![MIT license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/cucumber/aruba/master/LICENSE)
2
- [![Docs](https://img.shields.io/badge/cucumber.pro-aruba-3d10af.svg)](https://app.cucumber.pro/projects/aruba)
1
+ [![MIT license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/cucumber/aruba/main/LICENSE)
3
2
  [![Gem Version](https://badge.fury.io/rb/aruba.svg)](http://badge.fury.io/rb/aruba)
4
- [![Code Climate](https://codeclimate.com/github/cucumber/aruba.svg)](https://codeclimate.com/github/cucumber/aruba)
5
3
  [![Support](https://img.shields.io/badge/cucumber-support-orange.svg)](https://cucumber.io/support)
6
-
7
- [![Travis CI build status](https://travis-ci.org/cucumber/aruba.svg)](https://travis-ci.org/cucumber/aruba)
8
- [![Appveyor build status](https://ci.appveyor.com/api/projects/status/jfo2tkqhnrqqcivl?svg=true)](https://ci.appveyor.com/project/cucumberbdd/aruba)
4
+ [![Build Status](https://github.com/cucumber/aruba/actions/workflows/ruby.yml/badge.svg)](https://github.com/cucumber/aruba/actions/workflows/ruby.yml)
9
5
 
10
6
  ## Install
11
7
 
@@ -32,7 +28,7 @@ gem install aruba
32
28
  ### As a user getting started with Aruba
33
29
 
34
30
  Our most current documentation to get started with Aruba as a user can be
35
- found in [./features/](https://github.com/cucumber/aruba/tree/master/features/).
31
+ found in [./features/](https://github.com/cucumber/aruba/tree/main/features/).
36
32
 
37
33
  ### As a user getting started with a ruby testing framework
38
34
 
@@ -57,15 +53,15 @@ A full documentation of the API for developers can be found on
57
53
 
58
54
  ## Support
59
55
 
60
- ### Channels
61
-
62
56
  For support, please have a look at the [support website](https://cucumber.io/support)
63
57
  of Cucumber. You have different options to reach out for help: Recommended for
64
58
  Aruba are using the Slack channels &mdash; e.g. `committers-aruba` or `help-cucumber-ruby`
65
- &mdash; ([register account](https://cucumberbdd-slack-invite.herokuapp.com/)), and the
59
+ &mdash; ([register account](https://cucumberbdd-slack-invite.herokuapp.com/))
60
+
61
+ Concrete issues can be reported via the
66
62
  [Issues page on GitHub](https://github.com/cucumber/aruba/issues).
67
63
 
68
- ### Maintainers
64
+ ## Maintainers
69
65
 
70
66
  Currently, this gem is mainly maintained by this group of people:
71
67
 
@@ -73,12 +69,19 @@ Currently, this gem is mainly maintained by this group of people:
73
69
 
74
70
  ## Release Policy
75
71
 
76
- We try to comply with [Semantic Versioning 2.0.0](http://semver.org/spec/v2.0.0.html).
72
+ We use [Semantic Versioning 2.0.0](http://semver.org/spec/v2.0.0.html). We
73
+ depend on rubygems to ensure correct dependency versions, so dropping support
74
+ for older dependencies and Ruby versions will not result in a major version
75
+ bump.
77
76
 
78
77
  ## Supported Ruby versions
79
78
 
80
- Aruba is supported on Ruby 2.4 and up, and tested against CRuby 2.4, 2.5, 2.6
81
- and 2.7, and JRuby 9.2.
79
+ Aruba is supported on Ruby 2.5 and up, and tested against CRuby 2.5, 2.6, 2.7, 3.0 and
80
+ 3.1, and JRuby 9.2 and 9.2.
81
+
82
+ ## Supported Cucumber versions
83
+
84
+ Aruba is supported on and tested with Cucumber versions 4 through 7.
82
85
 
83
86
  ## Supported operating systems
84
87
 
@@ -91,10 +94,10 @@ Please see the [CONTRIBUTING](CONTRIBUTING.md) file.
91
94
 
92
95
  ## Code branches
93
96
 
94
- Development takes place in the `master` branch and currently targets the 1.x
95
- releases. If necessary, maintenance of the old 0.14.x releases takes place in
96
- the `0-14-stable` branch. Stable branches will not be created until absolutely
97
- necessary.
97
+ Development takes place in the `main` branch and currently targets the 2.x
98
+ releases. If necessary, maintenance of the old 1.1.x releases will take place
99
+ in a `1-1-stable` branch, and of 0.14.x releases in the `0-14-stable` branch.
100
+ Stable branches will not be created until absolutely necessary.
98
101
 
99
102
  ## License
100
103
 
@@ -1,4 +1,5 @@
1
1
  require "aruba/api/environment"
2
+ require "bundler"
2
3
 
3
4
  module Aruba
4
5
  module Api
@@ -226,8 +226,6 @@ module Aruba
226
226
  stop_signal = opts[:stop_signal] || aruba.config.stop_signal
227
227
  startup_wait_time = opts[:startup_wait_time] || aruba.config.startup_wait_time
228
228
 
229
- cmd = replace_variables(cmd)
230
-
231
229
  @commands ||= []
232
230
  @commands << cmd
233
231
 
@@ -117,34 +117,36 @@ module Aruba
117
117
  #
118
118
  # @example Single file name
119
119
  #
120
- # # => <path>/tmp/aruba/file
121
120
  # expand_path('file')
121
+ # # => <path>/tmp/aruba/file
122
122
  #
123
123
  # @example Single Dot
124
124
  #
125
- # # => <path>/tmp/aruba
126
125
  # expand_path('.')
126
+ # # => <path>/tmp/aruba
127
127
  #
128
128
  # @example using home directory
129
129
  #
130
- # # => <path>/home/<name>/file
131
130
  # expand_path('~/file')
131
+ # # => <path>/home/<name>/file
132
132
  #
133
133
  # @example using fixtures directory
134
134
  #
135
- # # => <path>/test/fixtures/file
136
135
  # expand_path('%/file')
136
+ # # => <path>/test/fixtures/file
137
137
  #
138
- # @example Absolute directory
138
+ # @example Absolute directory (requires aruba.config.allow_absolute_paths
139
+ # to be set)
139
140
  #
140
- # # => /foo/bar
141
141
  # expand_path('/foo/bar')
142
+ # # => /foo/bar
142
143
  #
143
144
  def expand_path(file_name, dir_string = nil)
144
145
  unless file_name.is_a?(String) && !file_name.empty?
145
146
  message = "Filename #{file_name} needs to be a string." \
146
- " It cannot be nil or empty either. "\
147
- "Please use `expand_path('.')` if you want the current directory to be expanded."
147
+ " It cannot be nil or empty either."\
148
+ " Please use `expand_path('.')` if you want" \
149
+ " the current directory to be expanded."
148
150
 
149
151
  raise ArgumentError, message
150
152
  end
@@ -152,12 +154,12 @@ module Aruba
152
154
  unless Aruba.platform.directory? File.join(aruba.config.root_directory,
153
155
  aruba.config.working_directory)
154
156
  raise "Aruba's working directory does not exist." \
155
- " Maybe you forgot to run `setup_aruba` before using its API."
157
+ " Maybe you forgot to run `setup_aruba` before using its API."
156
158
  end
157
159
 
158
160
  prefix = file_name[0]
159
161
 
160
- if aruba.config.fixtures_path_prefix == prefix
162
+ if prefix == aruba.config.fixtures_path_prefix
161
163
  rest = file_name[2..-1]
162
164
  path = File.join(*[aruba.fixtures_directory, rest].compact)
163
165
  unless Aruba.platform.exist? path
@@ -189,11 +191,13 @@ module Aruba
189
191
  unless aruba.config.allow_absolute_paths
190
192
  caller_location = caller_locations(1, 1).first
191
193
  caller_file_line = "#{caller_location.path}:#{caller_location.lineno}"
192
- aruba.logger.warn \
194
+ message =
193
195
  "Aruba's `expand_path` method was called with an absolute path" \
194
196
  " at #{caller_file_line}, which is not recommended." \
197
+ " The path passed was '#{file_name}'." \
195
198
  " Change the call to pass a relative path or set "\
196
199
  "`config.allow_absolute_paths = true` to silence this warning"
200
+ raise UserError, message
197
201
  end
198
202
  file_name
199
203
  else
@@ -326,12 +326,6 @@ module Aruba
326
326
  def append_to_file(file_name, file_content)
327
327
  file_name = expand_path(file_name)
328
328
 
329
- unless File.exist? file_name
330
- Aruba.platform.deprecated("The ability to call #append_to_file with a file that" \
331
- " does not exist is deprecated and will be removed in" \
332
- " Aruba 2.0.")
333
- Aruba.platform.mkdir(File.dirname(file_name))
334
- end
335
329
  File.open(file_name, "a") { |f| f << file_content }
336
330
  end
337
331
 
@@ -412,7 +406,7 @@ module Aruba
412
406
  # Bytes on disk
413
407
  def disk_usage(*paths)
414
408
  paths = paths.flatten
415
- expect(paths).to Aruba::Matchers.all be_an_existing_path
409
+ expect(paths).to all be_an_existing_path
416
410
  expanded = paths.map { |path| expand_path(path) }
417
411
 
418
412
  Aruba.platform.determine_disk_usage(expanded)
@@ -45,18 +45,6 @@ module Aruba
45
45
 
46
46
  text.chomp
47
47
  end
48
-
49
- # Replace variables in command string (experimental)
50
- #
51
- # @param [#to_s] text
52
- # The text to parse
53
- def replace_variables(text)
54
- if text.include? "<pid-last-command-started>"
55
- text = text.gsub(/<pid-last-command-started>/, last_command_started.pid.to_s)
56
- end
57
-
58
- text
59
- end
60
48
  end
61
49
  end
62
50
  end
data/lib/aruba/console.rb CHANGED
@@ -43,7 +43,7 @@ module Aruba
43
43
  end
44
44
 
45
45
  def inspect
46
- "nil"
46
+ "aruba console"
47
47
  end
48
48
  end
49
49
 
@@ -14,6 +14,7 @@ module Aruba
14
14
 
15
15
  # Create contract
16
16
  def initialize(*vals)
17
+ super()
17
18
  @vals = vals
18
19
  end
19
20