aruba 1.0.1 → 1.1.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +56 -1
- data/CONTRIBUTING.md +11 -23
- data/README.md +1 -2
- data/exe/aruba +2 -2
- data/lib/aruba.rb +1 -1
- data/lib/aruba/api.rb +11 -12
- data/lib/aruba/api/bundler.rb +18 -3
- data/lib/aruba/api/commands.rb +11 -11
- data/lib/aruba/api/core.rb +27 -25
- data/lib/aruba/api/environment.rb +2 -2
- data/lib/aruba/api/filesystem.rb +42 -16
- data/lib/aruba/api/text.rb +4 -4
- data/lib/aruba/aruba_path.rb +3 -4
- data/lib/aruba/basic_configuration.rb +51 -69
- data/lib/aruba/cli.rb +7 -7
- data/lib/aruba/command.rb +4 -4
- data/lib/aruba/config/jruby.rb +9 -9
- data/lib/aruba/config_wrapper.rb +2 -2
- data/lib/aruba/configuration.rb +36 -46
- data/lib/aruba/console.rb +11 -11
- data/lib/aruba/console/help.rb +7 -7
- data/lib/aruba/contracts/absolute_path.rb +1 -1
- data/lib/aruba/contracts/enum.rb +1 -1
- data/lib/aruba/contracts/is_power_of_two.rb +1 -1
- data/lib/aruba/contracts/relative_path.rb +1 -1
- data/lib/aruba/cucumber.rb +7 -7
- data/lib/aruba/cucumber/command.rb +41 -49
- data/lib/aruba/cucumber/environment.rb +7 -7
- data/lib/aruba/cucumber/file.rb +8 -4
- data/lib/aruba/cucumber/hooks.rb +29 -29
- data/lib/aruba/cucumber/testing_frameworks.rb +18 -18
- data/lib/aruba/event_bus.rb +4 -4
- data/lib/aruba/event_bus/name_resolver.rb +4 -4
- data/lib/aruba/file_size.rb +1 -1
- data/lib/aruba/generators/script_file.rb +2 -2
- data/lib/aruba/in_config_wrapper.rb +1 -1
- data/lib/aruba/initializer.rb +10 -10
- data/lib/aruba/matchers/base/base_matcher.rb +1 -1
- data/lib/aruba/matchers/base/message_indenter.rb +2 -2
- data/lib/aruba/matchers/base/object_formatter.rb +2 -2
- data/lib/aruba/matchers/collection.rb +1 -1
- data/lib/aruba/matchers/collection/all.rb +1 -1
- data/lib/aruba/matchers/collection/include_an_object.rb +2 -2
- data/lib/aruba/matchers/command.rb +1 -1
- data/lib/aruba/matchers/command/be_successfully_executed.rb +4 -4
- data/lib/aruba/matchers/command/have_finished_in_time.rb +1 -1
- data/lib/aruba/matchers/command/have_output.rb +1 -1
- data/lib/aruba/matchers/directory.rb +1 -1
- data/lib/aruba/matchers/directory/be_an_existing_directory.rb +2 -2
- data/lib/aruba/matchers/directory/have_sub_directory.rb +3 -3
- data/lib/aruba/matchers/environment.rb +1 -1
- data/lib/aruba/matchers/file.rb +1 -1
- data/lib/aruba/matchers/file/be_a_command_found_in_path.rb +1 -1
- data/lib/aruba/matchers/file/be_an_existing_executable.rb +2 -2
- data/lib/aruba/matchers/file/be_an_existing_file.rb +2 -2
- data/lib/aruba/matchers/file/have_file_content.rb +1 -1
- data/lib/aruba/matchers/file/have_file_size.rb +1 -1
- data/lib/aruba/matchers/file/have_same_file_content.rb +2 -2
- data/lib/aruba/matchers/path.rb +1 -1
- data/lib/aruba/matchers/path/a_path_matching_pattern.rb +1 -1
- data/lib/aruba/matchers/path/be_an_absolute_path.rb +1 -1
- data/lib/aruba/matchers/path/be_an_existing_path.rb +1 -1
- data/lib/aruba/matchers/path/have_permissions.rb +5 -4
- data/lib/aruba/matchers/string.rb +1 -1
- data/lib/aruba/matchers/string/include_output_string.rb +1 -1
- data/lib/aruba/matchers/string/match_output_string.rb +1 -1
- data/lib/aruba/matchers/string/output_string_eq.rb +1 -1
- data/lib/aruba/platform.rb +2 -2
- data/lib/aruba/platforms/announcer.rb +15 -15
- data/lib/aruba/platforms/aruba_fixed_size_file_creator.rb +1 -1
- data/lib/aruba/platforms/aruba_logger.rb +11 -10
- data/lib/aruba/platforms/command_monitor.rb +6 -8
- data/lib/aruba/platforms/determine_disk_usage.rb +2 -4
- data/lib/aruba/platforms/filesystem_status.rb +20 -14
- data/lib/aruba/platforms/simple_table.rb +3 -3
- data/lib/aruba/platforms/unix_command_string.rb +2 -2
- data/lib/aruba/platforms/unix_environment_variables.rb +1 -1
- data/lib/aruba/platforms/unix_platform.rb +23 -23
- data/lib/aruba/platforms/unix_which.rb +1 -1
- data/lib/aruba/platforms/windows_command_string.rb +2 -2
- data/lib/aruba/platforms/windows_environment_variables.rb +1 -1
- data/lib/aruba/platforms/windows_platform.rb +7 -7
- data/lib/aruba/platforms/windows_which.rb +5 -5
- data/lib/aruba/processes/basic_process.rb +4 -4
- data/lib/aruba/processes/debug_process.rb +5 -5
- data/lib/aruba/processes/in_process.rb +8 -8
- data/lib/aruba/processes/spawn_process.rb +18 -23
- data/lib/aruba/rspec.rb +6 -6
- data/lib/aruba/runtime.rb +6 -6
- data/lib/aruba/setup.rb +3 -3
- data/lib/aruba/version.rb +1 -1
- metadata +75 -94
- data/.cucumberproignore +0 -3
- data/.document +0 -5
- data/.github/ISSUE_TEMPLATE.md +0 -48
- data/.github/PULL_REQUEST_TEMPLATE.md +0 -41
- data/.gitignore +0 -38
- data/.rspec +0 -3
- data/.rubocop.yml +0 -52
- data/.rubocop_todo.yml +0 -216
- data/.simplecov +0 -36
- data/.travis.yml +0 -62
- data/.yardopts +0 -11
- data/Dockerfile +0 -67
- data/Gemfile +0 -14
- data/Rakefile +0 -82
- data/TODO.md +0 -13
- data/appveyor.yml +0 -28
- data/aruba.gemspec +0 -57
- data/bin/console +0 -7
- data/bin/test +0 -9
- data/config/.gitignore +0 -1
- data/cucumber.yml +0 -6
- data/docker-compose.yml +0 -26
- data/fixtures/cli-app/.gitignore +0 -9
- data/fixtures/cli-app/.rspec +0 -2
- data/fixtures/cli-app/README.md +0 -39
- data/fixtures/cli-app/Rakefile +0 -1
- data/fixtures/cli-app/bin/aruba-test-cli +0 -6
- data/fixtures/cli-app/cli-app.gemspec +0 -26
- data/fixtures/cli-app/features/support/aruba.rb +0 -1
- data/fixtures/cli-app/features/support/env.rb +0 -1
- data/fixtures/cli-app/lib/cli/app.rb +0 -9
- data/fixtures/cli-app/lib/cli/app/suppress_simple_cov_output.rb +0 -15
- data/fixtures/cli-app/lib/cli/app/version.rb +0 -5
- data/fixtures/cli-app/script/console +0 -14
- data/fixtures/cli-app/spec/spec_helper.rb +0 -8
- data/fixtures/cli-app/spec/support/aruba.rb +0 -1
- data/fixtures/copy/file.txt +0 -1
- data/fixtures/empty-app/.gitignore +0 -9
- data/fixtures/empty-app/.rspec +0 -2
- data/fixtures/empty-app/README.md +0 -24
- data/fixtures/empty-app/Rakefile +0 -1
- data/fixtures/empty-app/cli-app.gemspec +0 -26
- data/fixtures/empty-app/lib/cli/app.rb +0 -7
- data/fixtures/empty-app/lib/cli/app/version.rb +0 -5
- data/fixtures/getting-started-app/.gitignore +0 -4
- data/fixtures/getting-started-app/Gemfile +0 -4
- data/fixtures/getting-started-app/README.md +0 -3
- data/fixtures/getting-started-app/features/support/env.rb +0 -1
- data/lib/aruba/extensions/string/strip.rb +0 -25
- data/lib/aruba/tasks/docker_helpers.rb +0 -156
data/lib/aruba/initializer.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "thor/group"
|
2
|
+
require "thor/actions"
|
3
3
|
|
4
4
|
# Aruba
|
5
5
|
module Aruba
|
@@ -15,7 +15,7 @@ module Aruba
|
|
15
15
|
|
16
16
|
# Add gem to gemfile
|
17
17
|
def add_gem
|
18
|
-
file =
|
18
|
+
file = "Gemfile"
|
19
19
|
creator = if File.exist? file
|
20
20
|
:append_to_file
|
21
21
|
else
|
@@ -24,9 +24,9 @@ module Aruba
|
|
24
24
|
|
25
25
|
content = if File.exist? file
|
26
26
|
file_ends_with_carriage_return =
|
27
|
-
File.open(file,
|
27
|
+
File.open(file, "r").readlines.last.match(/.*\n$/)
|
28
28
|
|
29
|
-
prefix = file_ends_with_carriage_return ?
|
29
|
+
prefix = file_ends_with_carriage_return ? "" : "\n"
|
30
30
|
|
31
31
|
%(#{prefix}gem 'aruba', '~> #{Aruba::VERSION}')
|
32
32
|
else
|
@@ -79,7 +79,7 @@ module Aruba
|
|
79
79
|
end
|
80
80
|
|
81
81
|
def create_helper
|
82
|
-
file =
|
82
|
+
file = "spec/spec_helper.rb"
|
83
83
|
creator = if File.exist? file
|
84
84
|
:append_to_file
|
85
85
|
else
|
@@ -95,7 +95,7 @@ module Aruba
|
|
95
95
|
end
|
96
96
|
|
97
97
|
def create_support_file
|
98
|
-
create_file
|
98
|
+
create_file "spec/support/aruba.rb", <<~EOS
|
99
99
|
require 'aruba/rspec'
|
100
100
|
EOS
|
101
101
|
end
|
@@ -120,7 +120,7 @@ module Aruba
|
|
120
120
|
end
|
121
121
|
|
122
122
|
def create_support_file
|
123
|
-
create_file
|
123
|
+
create_file "features/support/aruba.rb", <<~EOS
|
124
124
|
require 'aruba/cucumber'
|
125
125
|
EOS
|
126
126
|
end
|
@@ -145,7 +145,7 @@ module Aruba
|
|
145
145
|
end
|
146
146
|
|
147
147
|
def create_helper
|
148
|
-
file =
|
148
|
+
file = "test/test_helper.rb"
|
149
149
|
creator = if File.exist? file
|
150
150
|
:append_to_file
|
151
151
|
else
|
@@ -161,7 +161,7 @@ module Aruba
|
|
161
161
|
end
|
162
162
|
|
163
163
|
def create_example
|
164
|
-
create_file
|
164
|
+
create_file "test/use_aruba_with_minitest.rb", <<~EOS
|
165
165
|
$LOAD_PATH.unshift File.expand_path('../test', __FILE__)
|
166
166
|
|
167
167
|
require 'test_helper'
|
@@ -8,9 +8,9 @@ module Aruba
|
|
8
8
|
module_function
|
9
9
|
|
10
10
|
def indent_multiline_message(message)
|
11
|
-
message = message.sub(/\n+\z/,
|
11
|
+
message = message.sub(/\n+\z/, "")
|
12
12
|
message.lines.map do |line|
|
13
|
-
/\S/.match?(line) ?
|
13
|
+
/\S/.match?(line) ? " #{line}" : line
|
14
14
|
end.join
|
15
15
|
end
|
16
16
|
end
|
@@ -52,7 +52,7 @@ module Aruba
|
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
-
TIME_FORMAT =
|
55
|
+
TIME_FORMAT = "%Y-%m-%d %H:%M:%S".freeze
|
56
56
|
|
57
57
|
if Time.method_defined?(:nsec)
|
58
58
|
# @private
|
@@ -61,7 +61,7 @@ module Aruba
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
|
-
DATE_TIME_FORMAT =
|
64
|
+
DATE_TIME_FORMAT = "%a, %d %b %Y %H:%M:%S.%N %z".freeze
|
65
65
|
|
66
66
|
# ActiveSupport sometimes overrides inspect. If `ActiveSupport` is
|
67
67
|
# defined use a custom format string that includes more time precision.
|
@@ -1 +1 @@
|
|
1
|
-
Aruba.platform.require_matching_files(
|
1
|
+
Aruba.platform.require_matching_files("../collection/**/*.rb", __FILE__)
|
@@ -1 +1 @@
|
|
1
|
-
Aruba.platform.require_matching_files(
|
1
|
+
Aruba.platform.require_matching_files("../command/**/*.rb", __FILE__)
|
@@ -1,7 +1,7 @@
|
|
1
|
-
require
|
1
|
+
require "rspec/expectations/version"
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require "aruba/matchers/command/have_exit_status"
|
4
|
+
require "aruba/matchers/command/have_finished_in_time"
|
5
5
|
|
6
6
|
# @!method be_successfuly_executed
|
7
7
|
# This matchers checks if execution of <command> was successful
|
@@ -30,7 +30,7 @@ RSpec::Matchers.define :be_successfully_executed do
|
|
30
30
|
|
31
31
|
failure_message do |_actual|
|
32
32
|
"Expected `#{@actual}` to succeed" \
|
33
|
-
|
33
|
+
" but got non-zero exit status and the following output:" \
|
34
34
|
"\n\n#{@old_actual.output}\n"
|
35
35
|
end
|
36
36
|
end
|
@@ -1 +1 @@
|
|
1
|
-
Aruba.platform.require_matching_files(
|
1
|
+
Aruba.platform.require_matching_files("../directory/**/*.rb", __FILE__)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "rspec/expectations/version"
|
2
2
|
|
3
3
|
# @!method be_an_existing_directory
|
4
4
|
# This matchers checks if <directory> exists in filesystem
|
@@ -19,7 +19,7 @@ RSpec::Matchers.define :be_an_existing_directory do |_|
|
|
19
19
|
match do |actual|
|
20
20
|
stop_all_commands
|
21
21
|
|
22
|
-
raise
|
22
|
+
raise "String expected" unless actual.is_a? String
|
23
23
|
|
24
24
|
directory?(actual)
|
25
25
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "rspec/expectations/version"
|
2
2
|
|
3
3
|
# @!method have_sub_directory(sub_directory)
|
4
4
|
# This matchers checks if <directory> has given sub-directory
|
@@ -42,13 +42,13 @@ RSpec::Matchers.define :have_sub_directory do |expected|
|
|
42
42
|
|
43
43
|
failure_message do |actual|
|
44
44
|
format('expected that directory "%s" has the following sub-directories: %s.',
|
45
|
-
actual.join(
|
45
|
+
actual.join(", "),
|
46
46
|
expected)
|
47
47
|
end
|
48
48
|
|
49
49
|
failure_message_when_negated do |actual|
|
50
50
|
format('expected that directory "%s" does not have the following sub-directories: %s.',
|
51
|
-
actual.join(
|
51
|
+
actual.join(", "),
|
52
52
|
expected)
|
53
53
|
end
|
54
54
|
end
|
@@ -1 +1 @@
|
|
1
|
-
Aruba.platform.require_matching_files(
|
1
|
+
Aruba.platform.require_matching_files("../matchers/environment/*.rb", __FILE__)
|
data/lib/aruba/matchers/file.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Aruba.platform.require_matching_files(
|
1
|
+
Aruba.platform.require_matching_files("../file/**/*.rb", __FILE__)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "rspec/expectations/version"
|
2
2
|
|
3
3
|
# @!method be_an_existing_file
|
4
4
|
# This matchers checks if <file> exists in filesystem
|
@@ -19,7 +19,7 @@ RSpec::Matchers.define :be_an_existing_file do |_|
|
|
19
19
|
match do |actual|
|
20
20
|
stop_all_commands
|
21
21
|
|
22
|
-
raise
|
22
|
+
raise "String expected" unless actual.is_a? String
|
23
23
|
|
24
24
|
file?(actual)
|
25
25
|
end
|
data/lib/aruba/matchers/path.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Aruba.platform.require_matching_files(
|
1
|
+
Aruba.platform.require_matching_files("../path/**/*.rb", __FILE__)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "rspec/expectations/version"
|
2
2
|
|
3
3
|
# @!method have_permissions(permissions)
|
4
4
|
# This matchers checks if <file> or <directory> has <perm> permissions
|
@@ -39,10 +39,11 @@ RSpec::Matchers.define :have_permissions do |expected|
|
|
39
39
|
@old_actual = actual
|
40
40
|
@actual = permissions(expand_path(@old_actual))
|
41
41
|
|
42
|
-
@expected =
|
42
|
+
@expected = case expected
|
43
|
+
when Integer
|
43
44
|
expected.to_s(8)
|
44
|
-
|
45
|
-
expected.gsub(/^0*/,
|
45
|
+
when String
|
46
|
+
expected.gsub(/^0*/, "")
|
46
47
|
else
|
47
48
|
expected
|
48
49
|
end
|
@@ -1 +1 @@
|
|
1
|
-
Aruba.platform.require_matching_files(
|
1
|
+
Aruba.platform.require_matching_files("../string/**/*.rb", __FILE__)
|
@@ -18,7 +18,7 @@
|
|
18
18
|
# end
|
19
19
|
RSpec::Matchers.define :include_output_string do |expected|
|
20
20
|
match do |actual|
|
21
|
-
actual.force_encoding(
|
21
|
+
actual.force_encoding("UTF-8")
|
22
22
|
@expected = Regexp.new(Regexp.escape(sanitize_text(expected.to_s)), Regexp::MULTILINE)
|
23
23
|
@actual = sanitize_text(actual)
|
24
24
|
|
@@ -18,7 +18,7 @@
|
|
18
18
|
# end
|
19
19
|
RSpec::Matchers.define :match_output_string do |expected|
|
20
20
|
match do |actual|
|
21
|
-
actual.force_encoding(
|
21
|
+
actual.force_encoding("UTF-8")
|
22
22
|
@expected = Regexp.new(unescape_text(expected), Regexp::MULTILINE)
|
23
23
|
@actual = sanitize_text(actual)
|
24
24
|
|
data/lib/aruba/platform.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "shellwords"
|
2
|
+
require "aruba/colorizer"
|
3
3
|
|
4
|
-
Aruba::Colorizer.coloring = false if
|
4
|
+
Aruba::Colorizer.coloring = false if !$stdout.tty? && !ENV.key?("AUTOTEST")
|
5
5
|
|
6
6
|
# Aruba
|
7
7
|
module Aruba
|
@@ -81,29 +81,29 @@ module Aruba
|
|
81
81
|
private
|
82
82
|
|
83
83
|
def after_init
|
84
|
-
output_format :changed_configuration, proc { |n, v| format(
|
84
|
+
output_format :changed_configuration, proc { |n, v| format("# %s = %s", n, v) }
|
85
85
|
output_format :changed_environment,
|
86
|
-
proc { |n, v| format(
|
87
|
-
output_format :command,
|
88
|
-
output_format :directory,
|
86
|
+
proc { |n, v| format("$ export %s=%s", n, Shellwords.escape(v)) }
|
87
|
+
output_format :command, "$ %s"
|
88
|
+
output_format :directory, "$ cd %s"
|
89
89
|
output_format :environment,
|
90
|
-
proc { |n, v| format(
|
90
|
+
proc { |n, v| format("$ export %s=%s", n, Shellwords.escape(v)) }
|
91
91
|
output_format :full_environment,
|
92
92
|
proc { |h|
|
93
93
|
format("<<-ENVIRONMENT\n%s\nENVIRONMENT",
|
94
94
|
Aruba.platform.simple_table(h))
|
95
95
|
}
|
96
96
|
output_format :modified_environment,
|
97
|
-
proc { |n, v| format(
|
97
|
+
proc { |n, v| format("$ export %s=%s", n, Shellwords.escape(v)) }
|
98
98
|
output_format :stderr, "<<-STDERR\n%s\nSTDERR"
|
99
99
|
output_format :stdout, "<<-STDOUT\n%s\nSTDOUT"
|
100
100
|
output_format :command_content, "<<-COMMAND\n%s\nCOMMAND"
|
101
101
|
output_format :stop_signal,
|
102
102
|
proc { |p, s|
|
103
|
-
format(
|
103
|
+
format("Command will be stopped with `kill -%s %s`", s, p)
|
104
104
|
}
|
105
|
-
output_format :timeout,
|
106
|
-
output_format :wait_time,
|
105
|
+
output_format :timeout, "# %s-timeout: %s seconds"
|
106
|
+
output_format :wait_time, "# %s: %s seconds"
|
107
107
|
output_format :command_filesystem_status,
|
108
108
|
proc { |status|
|
109
109
|
format("<<-COMMAND FILESYSTEM STATUS\n%s\nCOMMAND FILESYSTEM STATUS",
|
@@ -111,8 +111,8 @@ module Aruba
|
|
111
111
|
}
|
112
112
|
end
|
113
113
|
|
114
|
-
def output_format(channel, string =
|
115
|
-
output_formats[channel.to_sym] = if
|
114
|
+
def output_format(channel, string = "%s", &block)
|
115
|
+
output_formats[channel.to_sym] = if block
|
116
116
|
block
|
117
117
|
elsif string.is_a?(Proc)
|
118
118
|
string
|
@@ -180,7 +180,7 @@ module Aruba
|
|
180
180
|
the_output_format = if output_formats.key? channel
|
181
181
|
output_formats[channel]
|
182
182
|
else
|
183
|
-
proc { |v| format(
|
183
|
+
proc { |v| format("%s", v) }
|
184
184
|
end
|
185
185
|
|
186
186
|
return unless activated?(channel)
|