aruba 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +29 -8
- data/.rubocop_todo.yml +100 -146
- data/CHANGELOG.md +23 -1
- data/CONTRIBUTING.md +0 -8
- data/Gemfile +3 -1
- data/Rakefile +6 -4
- data/appveyor.yml +0 -1
- data/aruba.gemspec +7 -4
- data/fixtures/cli-app/cli-app.gemspec +3 -2
- data/fixtures/cli-app/spec/spec_helper.rb +2 -1
- data/fixtures/empty-app/cli-app.gemspec +3 -2
- data/lib/aruba/api/bundler.rb +1 -1
- data/lib/aruba/api/commands.rb +8 -11
- data/lib/aruba/api/core.rb +48 -33
- data/lib/aruba/api/environment.rb +12 -4
- data/lib/aruba/api/filesystem.rb +27 -23
- data/lib/aruba/api/text.rb +15 -3
- data/lib/aruba/basic_configuration.rb +5 -6
- data/lib/aruba/basic_configuration/option.rb +2 -2
- data/lib/aruba/cli.rb +4 -1
- data/lib/aruba/config_wrapper.rb +17 -2
- data/lib/aruba/configuration.rb +27 -12
- data/lib/aruba/console.rb +0 -2
- data/lib/aruba/console/help.rb +5 -2
- data/lib/aruba/contracts/absolute_path.rb +1 -1
- data/lib/aruba/contracts/is_power_of_two.rb +2 -2
- data/lib/aruba/contracts/relative_path.rb +1 -1
- data/lib/aruba/cucumber/command.rb +83 -64
- data/lib/aruba/cucumber/file.rb +42 -22
- data/lib/aruba/cucumber/hooks.rb +4 -1
- data/lib/aruba/cucumber/testing_frameworks.rb +14 -12
- data/lib/aruba/event_bus.rb +4 -2
- data/lib/aruba/event_bus/name_resolver.rb +9 -8
- data/lib/aruba/events.rb +2 -1
- data/lib/aruba/hooks.rb +2 -4
- data/lib/aruba/in_config_wrapper.rb +8 -5
- data/lib/aruba/initializer.rb +5 -3
- data/lib/aruba/matchers/base/base_matcher.rb +2 -11
- data/lib/aruba/matchers/base/object_formatter.rb +0 -3
- data/lib/aruba/matchers/collection/include_an_object.rb +4 -4
- data/lib/aruba/matchers/command/be_successfully_executed.rb +3 -1
- data/lib/aruba/matchers/command/have_exit_status.rb +3 -1
- data/lib/aruba/matchers/command/have_finished_in_time.rb +3 -1
- data/lib/aruba/matchers/command/have_output.rb +3 -1
- data/lib/aruba/matchers/command/have_output_on_stderr.rb +3 -1
- data/lib/aruba/matchers/command/have_output_on_stdout.rb +3 -1
- data/lib/aruba/matchers/directory/have_sub_directory.rb +8 -3
- data/lib/aruba/matchers/file/have_file_size.rb +4 -2
- data/lib/aruba/matchers/path/have_permissions.rb +4 -2
- data/lib/aruba/platforms/announcer.rb +18 -6
- data/lib/aruba/platforms/aruba_file_creator.rb +3 -1
- data/lib/aruba/platforms/aruba_fixed_size_file_creator.rb +7 -2
- data/lib/aruba/platforms/command_monitor.rb +3 -3
- data/lib/aruba/platforms/unix_environment_variables.rb +2 -4
- data/lib/aruba/platforms/unix_which.rb +1 -1
- data/lib/aruba/platforms/windows_environment_variables.rb +2 -1
- data/lib/aruba/platforms/windows_which.rb +6 -2
- data/lib/aruba/processes/debug_process.rb +4 -2
- data/lib/aruba/processes/in_process.rb +4 -2
- data/lib/aruba/processes/spawn_process.rb +18 -10
- data/lib/aruba/rspec.rb +25 -15
- data/lib/aruba/runtime.rb +11 -4
- data/lib/aruba/setup.rb +23 -10
- data/lib/aruba/tasks/docker_helpers.rb +3 -1
- data/lib/aruba/version.rb +1 -1
- metadata +22 -8
data/lib/aruba/runtime.rb
CHANGED
@@ -42,14 +42,16 @@ module Aruba
|
|
42
42
|
def initialize(opts = {})
|
43
43
|
@event_bus = EventBus.new(EventBus::NameResolver.new(Aruba::Events))
|
44
44
|
@announcer = opts.fetch(:announcer, Aruba.platform.announcer.new)
|
45
|
-
@config = opts.fetch(:config,
|
45
|
+
@config = opts.fetch(:config,
|
46
|
+
ConfigWrapper.new(Aruba.config.make_copy, @event_bus))
|
46
47
|
@environment = opts.fetch(:environment, Aruba.platform.environment_variables.new)
|
47
48
|
@current_directory = ArubaPath.new(@config.working_directory)
|
48
49
|
@root_directory = ArubaPath.new(@config.root_directory)
|
49
50
|
|
50
51
|
@environment.update(@config.command_runtime_environment)
|
51
52
|
|
52
|
-
@command_monitor = opts.fetch(:command_monitor,
|
53
|
+
@command_monitor = opts.fetch(:command_monitor,
|
54
|
+
Aruba.platform.command_monitor.new(announcer: @announcer))
|
53
55
|
|
54
56
|
@logger = opts.fetch(:logger, Aruba.platform.logger.new)
|
55
57
|
@logger.mode = @config.log_level
|
@@ -81,12 +83,17 @@ module Aruba
|
|
81
83
|
candidates = config.fixtures_directories.map { |dir| File.join(root_directory, dir) }
|
82
84
|
directory = candidates.find { |d| Aruba.platform.directory? d }
|
83
85
|
|
84
|
-
|
86
|
+
unless directory
|
87
|
+
canditates_display = candidates.map { |d| format('"%s"', d) }.join(', ')
|
88
|
+
raise "No existing fixtures directory found in #{canditates_display}."
|
89
|
+
end
|
85
90
|
|
86
91
|
directory
|
87
92
|
end
|
88
93
|
|
89
|
-
|
94
|
+
unless Aruba.platform.directory?(@fixtures_directory)
|
95
|
+
raise %(Fixtures directory "#{@fixtures_directory}" is not a directory)
|
96
|
+
end
|
90
97
|
|
91
98
|
ArubaPath.new(@fixtures_directory)
|
92
99
|
end
|
data/lib/aruba/setup.rb
CHANGED
@@ -25,13 +25,15 @@ module Aruba
|
|
25
25
|
|
26
26
|
def working_directory(clobber = true)
|
27
27
|
if clobber
|
28
|
-
Aruba.platform.rm File.join(runtime.config.root_directory,
|
28
|
+
Aruba.platform.rm File.join(runtime.config.root_directory,
|
29
|
+
runtime.config.working_directory),
|
30
|
+
force: true
|
29
31
|
end
|
30
|
-
Aruba.platform.mkdir File.join(runtime.config.root_directory,
|
32
|
+
Aruba.platform.mkdir File.join(runtime.config.root_directory,
|
33
|
+
runtime.config.working_directory)
|
31
34
|
Aruba.platform.chdir runtime.config.root_directory
|
32
35
|
end
|
33
36
|
|
34
|
-
# rubocop:disable Metrics/MethodLength
|
35
37
|
def events
|
36
38
|
runtime.event_bus.register(
|
37
39
|
:command_started,
|
@@ -39,7 +41,8 @@ module Aruba
|
|
39
41
|
runtime.announcer.announce(:command) { event.entity.commandline }
|
40
42
|
runtime.announcer.announce(:timeout, 'exit') { event.entity.exit_timeout }
|
41
43
|
runtime.announcer.announce(:timeout, 'io wait') { event.entity.io_wait_timeout }
|
42
|
-
runtime.announcer
|
44
|
+
runtime.announcer
|
45
|
+
.announce(:wait_time, 'startup wait time') { event.entity.startup_wait_time }
|
43
46
|
runtime.announcer.announce(:full_environment) { event.entity.environment }
|
44
47
|
end
|
45
48
|
)
|
@@ -58,7 +61,8 @@ module Aruba
|
|
58
61
|
runtime.announcer.announce(:stdout) { event.entity.stdout }
|
59
62
|
runtime.announcer.announce(:stderr) { event.entity.stderr }
|
60
63
|
runtime.announcer.announce(:command_content) { event.entity.content }
|
61
|
-
runtime.announcer
|
64
|
+
runtime.announcer
|
65
|
+
.announce(:command_filesystem_status) { event.entity.filesystem_status }
|
62
66
|
end
|
63
67
|
)
|
64
68
|
|
@@ -70,10 +74,16 @@ module Aruba
|
|
70
74
|
)
|
71
75
|
|
72
76
|
runtime.event_bus.register(
|
73
|
-
[:changed_environment_variable,
|
77
|
+
[:changed_environment_variable,
|
78
|
+
:added_environment_variable,
|
79
|
+
:deleted_environment_variable],
|
74
80
|
proc do |event|
|
75
|
-
runtime.announcer.announce :changed_environment,
|
76
|
-
|
81
|
+
runtime.announcer.announce :changed_environment,
|
82
|
+
event.entity[:changed][:name],
|
83
|
+
event.entity[:changed][:value]
|
84
|
+
runtime.announcer.announce :environment,
|
85
|
+
event.entity[:changed][:name],
|
86
|
+
event.entity[:changed][:value]
|
77
87
|
end
|
78
88
|
)
|
79
89
|
|
@@ -84,9 +94,12 @@ module Aruba
|
|
84
94
|
|
85
95
|
runtime.event_bus.register(
|
86
96
|
:changed_configuration,
|
87
|
-
proc { |event|
|
97
|
+
proc { |event|
|
98
|
+
runtime.announcer.announce :configuration,
|
99
|
+
event.entity[:changed][:name],
|
100
|
+
event.entity[:changed][:value]
|
101
|
+
}
|
88
102
|
)
|
89
103
|
end
|
90
|
-
# rubocop:enable Metrics/MethodLength
|
91
104
|
end
|
92
105
|
end
|
data/lib/aruba/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aruba
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aslak Hellesøy, Matt Wynne and other Aruba Contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: childprocess
|
@@ -47,7 +47,7 @@ dependencies:
|
|
47
47
|
version: '2.4'
|
48
48
|
- - "<"
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: '
|
50
|
+
version: '5.0'
|
51
51
|
type: :runtime
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -57,7 +57,7 @@ dependencies:
|
|
57
57
|
version: '2.4'
|
58
58
|
- - "<"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
60
|
+
version: '5.0'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: ffi
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -190,14 +190,14 @@ dependencies:
|
|
190
190
|
requirements:
|
191
191
|
- - "~>"
|
192
192
|
- !ruby/object:Gem::Version
|
193
|
-
version: 0.
|
193
|
+
version: 0.84.0
|
194
194
|
type: :development
|
195
195
|
prerelease: false
|
196
196
|
version_requirements: !ruby/object:Gem::Requirement
|
197
197
|
requirements:
|
198
198
|
- - "~>"
|
199
199
|
- !ruby/object:Gem::Version
|
200
|
-
version: 0.
|
200
|
+
version: 0.84.0
|
201
201
|
- !ruby/object:Gem::Dependency
|
202
202
|
name: rubocop-performance
|
203
203
|
requirement: !ruby/object:Gem::Requirement
|
@@ -212,6 +212,20 @@ dependencies:
|
|
212
212
|
- - "~>"
|
213
213
|
- !ruby/object:Gem::Version
|
214
214
|
version: '1.5'
|
215
|
+
- !ruby/object:Gem::Dependency
|
216
|
+
name: rubocop-rspec
|
217
|
+
requirement: !ruby/object:Gem::Requirement
|
218
|
+
requirements:
|
219
|
+
- - "~>"
|
220
|
+
- !ruby/object:Gem::Version
|
221
|
+
version: '1.39'
|
222
|
+
type: :development
|
223
|
+
prerelease: false
|
224
|
+
version_requirements: !ruby/object:Gem::Requirement
|
225
|
+
requirements:
|
226
|
+
- - "~>"
|
227
|
+
- !ruby/object:Gem::Version
|
228
|
+
version: '1.39'
|
215
229
|
- !ruby/object:Gem::Dependency
|
216
230
|
name: simplecov
|
217
231
|
requirement: !ruby/object:Gem::Requirement
|
@@ -240,7 +254,7 @@ dependencies:
|
|
240
254
|
- - "~>"
|
241
255
|
- !ruby/object:Gem::Version
|
242
256
|
version: 0.0.7
|
243
|
-
description:
|
257
|
+
description: |
|
244
258
|
Extension for popular TDD and BDD frameworks like "Cucumber", "RSpec" and "Minitest",
|
245
259
|
to make testing commandline applications meaningful, easy and fun.
|
246
260
|
email: cukes@googlegroups.com
|
@@ -439,5 +453,5 @@ requirements: []
|
|
439
453
|
rubygems_version: 3.1.2
|
440
454
|
signing_key:
|
441
455
|
specification_version: 4
|
442
|
-
summary: aruba-1.0.
|
456
|
+
summary: aruba-1.0.1
|
443
457
|
test_files: []
|