aruba 1.0.4 → 1.1.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -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 -11
- data/lib/aruba/api/bundler.rb +1 -1
- data/lib/aruba/api/commands.rb +7 -7
- data/lib/aruba/api/core.rb +20 -20
- data/lib/aruba/api/environment.rb +2 -2
- data/lib/aruba/api/filesystem.rb +41 -14
- data/lib/aruba/api/text.rb +4 -4
- data/lib/aruba/aruba_path.rb +2 -2
- data/lib/aruba/basic_configuration.rb +11 -11
- 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 +14 -14
- data/lib/aruba/console.rb +11 -11
- data/lib/aruba/console/help.rb +5 -5
- 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 +31 -31
- data/lib/aruba/cucumber/environment.rb +7 -7
- data/lib/aruba/cucumber/file.rb +7 -3
- 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 +1 -1
- 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 +2 -2
- 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 +14 -14
- data/lib/aruba/platforms/aruba_fixed_size_file_creator.rb +1 -1
- data/lib/aruba/platforms/aruba_logger.rb +1 -1
- data/lib/aruba/platforms/command_monitor.rb +5 -5
- data/lib/aruba/platforms/determine_disk_usage.rb +1 -1
- data/lib/aruba/platforms/filesystem_status.rb +1 -1
- data/lib/aruba/platforms/simple_table.rb +1 -1
- data/lib/aruba/platforms/unix_command_string.rb +2 -2
- data/lib/aruba/platforms/unix_platform.rb +22 -22
- 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 +6 -6
- data/lib/aruba/platforms/windows_which.rb +5 -5
- data/lib/aruba/processes/basic_process.rb +2 -2
- data/lib/aruba/processes/debug_process.rb +5 -5
- data/lib/aruba/processes/in_process.rb +7 -7
- data/lib/aruba/processes/spawn_process.rb +17 -22
- 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 +21 -22
- data/lib/aruba/tasks/docker_helpers.rb +0 -156
data/lib/aruba/api/text.rb
CHANGED
@@ -30,9 +30,9 @@ module Aruba
|
|
30
30
|
# Input
|
31
31
|
def extract_text(text)
|
32
32
|
text
|
33
|
-
.gsub(/(?:\e|\033)\[\d+(?>(;\d+)*)m/,
|
34
|
-
.gsub(/\\\[|\\\]/,
|
35
|
-
.gsub(/\007|\016|\017/,
|
33
|
+
.gsub(/(?:\e|\033)\[\d+(?>(;\d+)*)m/, "")
|
34
|
+
.gsub(/\\\[|\\\]/, "")
|
35
|
+
.gsub(/\007|\016|\017/, "")
|
36
36
|
end
|
37
37
|
|
38
38
|
# Unescape special characters and remove ANSI characters
|
@@ -51,7 +51,7 @@ module Aruba
|
|
51
51
|
# @param [#to_s] text
|
52
52
|
# The text to parse
|
53
53
|
def replace_variables(text)
|
54
|
-
if text.include?
|
54
|
+
if text.include? "<pid-last-command-started>"
|
55
55
|
text = text.gsub(/<pid-last-command-started>/, last_command_started.pid.to_s)
|
56
56
|
end
|
57
57
|
|
data/lib/aruba/aruba_path.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "pathname"
|
2
2
|
|
3
3
|
# Aruba
|
4
4
|
module Aruba
|
@@ -57,7 +57,7 @@ module Aruba
|
|
57
57
|
# Get path
|
58
58
|
def to_pathname
|
59
59
|
current_path = @obj.inject do |path, element|
|
60
|
-
if element.start_with?(
|
60
|
+
if element.start_with?("~") ||
|
61
61
|
Aruba.platform.absolute_path?(element)
|
62
62
|
element
|
63
63
|
else
|
@@ -1,6 +1,6 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
1
|
+
require "contracts"
|
2
|
+
require "aruba/basic_configuration/option"
|
3
|
+
require "aruba/in_config_wrapper"
|
4
4
|
|
5
5
|
# Aruba
|
6
6
|
module Aruba
|
@@ -26,7 +26,7 @@ module Aruba
|
|
26
26
|
# @option [Object] default
|
27
27
|
# The default value
|
28
28
|
def option_reader(name, type:, default: nil)
|
29
|
-
raise ArgumentError,
|
29
|
+
raise ArgumentError, "Either use block or default value" if block_given? && default
|
30
30
|
|
31
31
|
add_option(name, block_given? ? yield(InConfigWrapper.new(known_options)) : default)
|
32
32
|
|
@@ -46,7 +46,7 @@ module Aruba
|
|
46
46
|
# The default value
|
47
47
|
#
|
48
48
|
def option_accessor(name, type:, default: nil)
|
49
|
-
raise ArgumentError,
|
49
|
+
raise ArgumentError, "Either use block or default value" if block_given? && default
|
50
50
|
|
51
51
|
# Add writer
|
52
52
|
add_option(name, block_given? ? yield(InConfigWrapper.new(known_options)) : default)
|
@@ -110,8 +110,8 @@ module Aruba
|
|
110
110
|
# @yield
|
111
111
|
# The code block which should be run. This is a configure time only option
|
112
112
|
def before(name, &block)
|
113
|
-
name = format(
|
114
|
-
raise ArgumentError,
|
113
|
+
name = format("%s_%s", "before_", name.to_s).to_sym
|
114
|
+
raise ArgumentError, "A block is required" unless block
|
115
115
|
|
116
116
|
@hooks.append(name, block)
|
117
117
|
|
@@ -129,7 +129,7 @@ module Aruba
|
|
129
129
|
# @param [Array] args
|
130
130
|
# Arguments for the run of hook
|
131
131
|
def run_before_hook(name, context, *args)
|
132
|
-
name = format(
|
132
|
+
name = format("%s_%s", "before_", name.to_s).to_sym
|
133
133
|
|
134
134
|
@hooks.execute(name, context, *args)
|
135
135
|
end
|
@@ -142,8 +142,8 @@ module Aruba
|
|
142
142
|
# @yield
|
143
143
|
# The code block which should be run. This is a configure time only option
|
144
144
|
def after(name, &block)
|
145
|
-
name = format(
|
146
|
-
raise ArgumentError,
|
145
|
+
name = format("%s_%s", "after_", name.to_s).to_sym
|
146
|
+
raise ArgumentError, "A block is required" unless block
|
147
147
|
|
148
148
|
@hooks.append(name, block)
|
149
149
|
|
@@ -161,7 +161,7 @@ module Aruba
|
|
161
161
|
# @param [Array] args
|
162
162
|
# Arguments for the run of hook
|
163
163
|
def run_after_hook(name, context, *args)
|
164
|
-
name = format(
|
164
|
+
name = format("%s_%s", "after_", name.to_s).to_sym
|
165
165
|
|
166
166
|
@hooks.execute(name, context, *args)
|
167
167
|
end
|
data/lib/aruba/cli.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
1
|
+
require "thor"
|
2
|
+
require "aruba/console"
|
3
|
+
require "aruba/initializer"
|
4
4
|
|
5
5
|
# Aruba
|
6
6
|
module Aruba
|
@@ -12,16 +12,16 @@ module Aruba
|
|
12
12
|
true
|
13
13
|
end
|
14
14
|
|
15
|
-
desc
|
15
|
+
desc "console", "Start aruba's console"
|
16
16
|
def console
|
17
17
|
Aruba::Console.new.start
|
18
18
|
end
|
19
19
|
|
20
|
-
desc
|
20
|
+
desc "init", "Initialize aruba"
|
21
21
|
option :test_framework,
|
22
|
-
default:
|
22
|
+
default: "cucumber",
|
23
23
|
enum: %w(cucumber rspec minitest),
|
24
|
-
desc:
|
24
|
+
desc: "Choose which test framework to use"
|
25
25
|
def init
|
26
26
|
Aruba::Initializer.new.call(options[:test_framework])
|
27
27
|
end
|
data/lib/aruba/command.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
1
|
+
require "delegate"
|
2
|
+
require "aruba/processes/spawn_process"
|
3
|
+
require "aruba/processes/in_process"
|
4
|
+
require "aruba/processes/debug_process"
|
5
5
|
|
6
6
|
# Aruba
|
7
7
|
module Aruba
|
data/lib/aruba/config/jruby.rb
CHANGED
@@ -1,27 +1,27 @@
|
|
1
|
-
require
|
1
|
+
require "rbconfig"
|
2
2
|
|
3
3
|
# ideas taken from: http://blog.headius.com/2010/03/jruby-startup-time-tips.html
|
4
4
|
Aruba.configure do |config|
|
5
5
|
config.before :command do |command|
|
6
|
-
next unless RUBY_PLATFORM ==
|
6
|
+
next unless RUBY_PLATFORM == "java"
|
7
7
|
|
8
8
|
env = command.environment
|
9
9
|
|
10
|
-
jruby_opts = env[
|
10
|
+
jruby_opts = env["JRUBY_OPTS"] || ""
|
11
11
|
|
12
12
|
# disable JIT since these processes are so short lived
|
13
|
-
jruby_opts = "-X-C #{jruby_opts}" unless jruby_opts.include?
|
13
|
+
jruby_opts = "-X-C #{jruby_opts}" unless jruby_opts.include? "-X-C"
|
14
14
|
|
15
15
|
# Faster startup for jruby
|
16
|
-
jruby_opts = "--dev #{jruby_opts}" unless jruby_opts.include?
|
16
|
+
jruby_opts = "--dev #{jruby_opts}" unless jruby_opts.include? "--dev"
|
17
17
|
|
18
|
-
env[
|
18
|
+
env["JRUBY_OPTS"] = jruby_opts
|
19
19
|
|
20
|
-
if /solaris|sunos/i.match?(RbConfig::CONFIG[
|
21
|
-
java_opts = env[
|
20
|
+
if /solaris|sunos/i.match?(RbConfig::CONFIG["host_os"])
|
21
|
+
java_opts = env["JAVA_OPTS"] || ""
|
22
22
|
|
23
23
|
# force jRuby to use client JVM for faster startup times
|
24
|
-
env[
|
24
|
+
env["JAVA_OPTS"] = "-d32 #{java_opts}" unless java_opts.include?("-d32")
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
data/lib/aruba/config_wrapper.rb
CHANGED
@@ -30,7 +30,7 @@ module Aruba
|
|
30
30
|
# If one method ends with "=", e.g. ":option1=", then notify the event
|
31
31
|
# queue, that the user changes the value of "option1"
|
32
32
|
def method_missing(name, *args, &block)
|
33
|
-
notify(name, args) if name.to_s.end_with?(
|
33
|
+
notify(name, args) if name.to_s.end_with?("=")
|
34
34
|
|
35
35
|
return config.send(name, *args, &block) if config.respond_to? name
|
36
36
|
|
@@ -63,7 +63,7 @@ module Aruba
|
|
63
63
|
event_bus.notify(
|
64
64
|
Events::ChangedConfiguration.new(
|
65
65
|
changed: {
|
66
|
-
name: name.to_s.gsub(/=$/,
|
66
|
+
name: name.to_s.gsub(/=$/, ""),
|
67
67
|
value: args.first
|
68
68
|
}
|
69
69
|
)
|
data/lib/aruba/configuration.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
require
|
1
|
+
require "contracts"
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
3
|
+
require "aruba/version"
|
4
|
+
require "aruba/basic_configuration"
|
5
|
+
require "aruba/in_config_wrapper"
|
6
|
+
require "aruba/hooks"
|
7
7
|
|
8
|
-
require
|
9
|
-
require
|
10
|
-
require
|
8
|
+
require "aruba/contracts/relative_path"
|
9
|
+
require "aruba/contracts/absolute_path"
|
10
|
+
require "aruba/contracts/enum"
|
11
11
|
|
12
|
-
require
|
12
|
+
require "aruba/contracts/is_power_of_two"
|
13
13
|
|
14
14
|
# Aruba
|
15
15
|
module Aruba
|
@@ -21,9 +21,9 @@ module Aruba
|
|
21
21
|
|
22
22
|
option_accessor :working_directory,
|
23
23
|
type: Aruba::Contracts::RelativePath,
|
24
|
-
default:
|
24
|
+
default: "tmp/aruba"
|
25
25
|
|
26
|
-
option_reader :fixtures_path_prefix, type: String, default:
|
26
|
+
option_reader :fixtures_path_prefix, type: String, default: "%"
|
27
27
|
|
28
28
|
option_accessor :exit_timeout, type: Num, default: 15
|
29
29
|
option_accessor :stop_signal, type: Maybe[String], default: nil
|
@@ -36,8 +36,8 @@ module Aruba
|
|
36
36
|
option_accessor :command_runtime_environment, type: Hash, default: {}
|
37
37
|
option_accessor :command_search_paths,
|
38
38
|
type: ArrayOf[String] do |config|
|
39
|
-
[File.join(config.root_directory.value,
|
40
|
-
File.join(config.root_directory.value,
|
39
|
+
[File.join(config.root_directory.value, "bin"),
|
40
|
+
File.join(config.root_directory.value, "exe")]
|
41
41
|
end
|
42
42
|
option_accessor :remove_ansi_escape_sequences, type: Bool, default: true
|
43
43
|
option_accessor :command_launcher,
|
@@ -64,7 +64,7 @@ module Aruba
|
|
64
64
|
type: Aruba::Contracts::IsPowerOfTwo,
|
65
65
|
default: 512
|
66
66
|
option_accessor :console_history_file, type: String,
|
67
|
-
default:
|
67
|
+
default: "~/.aruba_history"
|
68
68
|
|
69
69
|
option_accessor :activate_announcer_on_command_failure,
|
70
70
|
type: ArrayOf[Symbol],
|
data/lib/aruba/console.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
require
|
1
|
+
require "irb"
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require "aruba/api"
|
4
|
+
require "aruba/console/help"
|
5
5
|
|
6
6
|
# Aruba
|
7
7
|
module Aruba
|
@@ -15,21 +15,21 @@ module Aruba
|
|
15
15
|
ARGV.clear
|
16
16
|
IRB.setup nil
|
17
17
|
|
18
|
-
IRB.conf[:IRB_NAME] =
|
18
|
+
IRB.conf[:IRB_NAME] = "aruba"
|
19
19
|
|
20
20
|
IRB.conf[:PROMPT] = {}
|
21
21
|
IRB.conf[:PROMPT][:ARUBA] = {
|
22
|
-
PROMPT_I:
|
23
|
-
PROMPT_S:
|
24
|
-
PROMPT_C:
|
22
|
+
PROMPT_I: "%N:%03n:%i> ",
|
23
|
+
PROMPT_S: "%N:%03n:%i%l ",
|
24
|
+
PROMPT_C: "%N:%03n:%i* ",
|
25
25
|
RETURN: "# => %s\n"
|
26
26
|
}
|
27
27
|
IRB.conf[:PROMPT_MODE] = :ARUBA
|
28
28
|
|
29
29
|
IRB.conf[:RC] = false
|
30
30
|
|
31
|
-
require
|
32
|
-
require
|
31
|
+
require "irb/completion"
|
32
|
+
require "irb/ext/save-history"
|
33
33
|
IRB.conf[:READLINE] = true
|
34
34
|
IRB.conf[:SAVE_HISTORY] = 1000
|
35
35
|
IRB.conf[:HISTORY_FILE] = Aruba.config.console_history_file
|
@@ -43,14 +43,14 @@ module Aruba
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def inspect
|
46
|
-
|
46
|
+
"nil"
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
50
|
irb = IRB::Irb.new(IRB::WorkSpace.new(context.new))
|
51
51
|
IRB.conf[:MAIN_CONTEXT] = irb.context
|
52
52
|
|
53
|
-
trap(
|
53
|
+
trap("SIGINT") do
|
54
54
|
irb.signal_handle
|
55
55
|
end
|
56
56
|
|
data/lib/aruba/console/help.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "aruba/api"
|
2
2
|
|
3
3
|
# Aruba
|
4
4
|
module Aruba
|
@@ -9,9 +9,9 @@ module Aruba
|
|
9
9
|
# Output help information
|
10
10
|
def aruba_help
|
11
11
|
puts "Aruba Version: #{Aruba::VERSION}"
|
12
|
-
puts
|
13
|
-
puts
|
14
|
-
puts
|
12
|
+
puts "Issue Tracker: https://github.com/cucumber/aruba/issues"
|
13
|
+
puts "Documentation:"
|
14
|
+
puts "* http://www.rubydoc.info/gems/aruba"
|
15
15
|
puts
|
16
16
|
|
17
17
|
nil
|
@@ -20,7 +20,7 @@ module Aruba
|
|
20
20
|
# List available methods in aruba
|
21
21
|
def aruba_methods
|
22
22
|
ms = (Aruba::Api.instance_methods - Module.instance_methods)
|
23
|
-
.each_with_object([]) { |e, a| a << format(
|
23
|
+
.each_with_object([]) { |e, a| a << format("* %s", e) }
|
24
24
|
.sort
|
25
25
|
|
26
26
|
puts "Available Methods:\n#{ms.join("\n")}"
|
data/lib/aruba/contracts/enum.rb
CHANGED
data/lib/aruba/cucumber.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
require
|
1
|
+
require "aruba/version"
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
8
|
-
require
|
3
|
+
require "aruba/api"
|
4
|
+
require "aruba/cucumber/hooks"
|
5
|
+
require "aruba/cucumber/command"
|
6
|
+
require "aruba/cucumber/environment"
|
7
|
+
require "aruba/cucumber/file"
|
8
|
+
require "aruba/cucumber/testing_frameworks"
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "aruba/generators/script_file"
|
2
2
|
|
3
3
|
When(/^I run `([^`]*)`$/) do |cmd|
|
4
4
|
cmd = sanitize_text(cmd)
|
@@ -14,9 +14,9 @@ end
|
|
14
14
|
|
15
15
|
When(/^I run the following (?:commands|script)(?: (?:with|in) `([^`]+)`)?:$/) \
|
16
16
|
do |shell, commands|
|
17
|
-
full_path = expand_path(
|
17
|
+
full_path = expand_path("bin/myscript")
|
18
18
|
|
19
|
-
Aruba.platform.mkdir(expand_path(
|
19
|
+
Aruba.platform.mkdir(expand_path("bin"))
|
20
20
|
shell ||= Aruba.platform.default_shell
|
21
21
|
|
22
22
|
Aruba::ScriptFile.new(interpreter: shell, content: commands, path: full_path).call
|
@@ -55,7 +55,7 @@ When(/^I (terminate|stop) the command (?:"([^"]*)"|(?:started last))$/) do |sign
|
|
55
55
|
last_command_started
|
56
56
|
end
|
57
57
|
|
58
|
-
if signal ==
|
58
|
+
if signal == "terminate"
|
59
59
|
cmd.terminate
|
60
60
|
else
|
61
61
|
cmd.stop
|
@@ -135,9 +135,9 @@ Then(
|
|
135
135
|
/^(?:the )?(output|stderr|stdout) from "([^"]*)" should contain( exactly)? "([^"]*)"$/
|
136
136
|
) do |channel, cmd, exactly, expected|
|
137
137
|
matcher = case channel
|
138
|
-
when
|
139
|
-
when
|
140
|
-
when
|
138
|
+
when "output"; then :have_output
|
139
|
+
when "stderr"; then :have_output_on_stderr
|
140
|
+
when "stdout"; then :have_output_on_stdout
|
141
141
|
end
|
142
142
|
|
143
143
|
command = aruba.command_monitor.find(Aruba.platform.detect_ruby(cmd))
|
@@ -156,9 +156,9 @@ Then(
|
|
156
156
|
/^(?:the )?(output|stderr|stdout) from "([^"]*)" should not contain( exactly)? "([^"]*)"$/
|
157
157
|
) do |channel, cmd, exactly, expected|
|
158
158
|
matcher = case channel
|
159
|
-
when
|
160
|
-
when
|
161
|
-
when
|
159
|
+
when "output"; then :have_output
|
160
|
+
when "stderr"; then :have_output_on_stderr
|
161
|
+
when "stdout"; then :have_output_on_stdout
|
162
162
|
end
|
163
163
|
|
164
164
|
command = aruba.command_monitor.find(Aruba.platform.detect_ruby(cmd))
|
@@ -204,9 +204,9 @@ end
|
|
204
204
|
Then(/^(?:the )?(output|stderr|stdout) from "([^"]*)" should not contain( exactly)?:$/) \
|
205
205
|
do |channel, cmd, exactly, expected|
|
206
206
|
matcher = case channel
|
207
|
-
when
|
208
|
-
when
|
209
|
-
when
|
207
|
+
when "output"; then :have_output
|
208
|
+
when "stderr"; then :have_output_on_stderr
|
209
|
+
when "stdout"; then :have_output_on_stdout
|
210
210
|
end
|
211
211
|
|
212
212
|
command = aruba.command_monitor.find(Aruba.platform.detect_ruby(cmd))
|
@@ -224,9 +224,9 @@ end
|
|
224
224
|
Then(/^(?:the )?(output|stderr|stdout) from "([^"]*)" should contain( exactly)?:$/) \
|
225
225
|
do |channel, cmd, exactly, expected|
|
226
226
|
matcher = case channel
|
227
|
-
when
|
228
|
-
when
|
229
|
-
when
|
227
|
+
when "output"; then :have_output
|
228
|
+
when "stderr"; then :have_output_on_stderr
|
229
|
+
when "stdout"; then :have_output_on_stdout
|
230
230
|
end
|
231
231
|
|
232
232
|
command = aruba.command_monitor.find(Aruba.platform.detect_ruby(cmd))
|
@@ -287,7 +287,7 @@ end
|
|
287
287
|
Then(/^it should not (pass|fail) with "(.*?)"$/) do |pass_fail, expected|
|
288
288
|
last_command_started.stop
|
289
289
|
|
290
|
-
if pass_fail ==
|
290
|
+
if pass_fail == "pass"
|
291
291
|
expect(last_command_stopped).to be_successfully_executed
|
292
292
|
else
|
293
293
|
expect(last_command_stopped).not_to be_successfully_executed
|
@@ -299,7 +299,7 @@ end
|
|
299
299
|
Then(/^it should (pass|fail) with "(.*?)"$/) do |pass_fail, expected|
|
300
300
|
last_command_started.stop
|
301
301
|
|
302
|
-
if pass_fail ==
|
302
|
+
if pass_fail == "pass"
|
303
303
|
expect(last_command_stopped).to be_successfully_executed
|
304
304
|
else
|
305
305
|
expect(last_command_stopped).not_to be_successfully_executed
|
@@ -311,7 +311,7 @@ end
|
|
311
311
|
Then(/^it should not (pass|fail) with:$/) do |pass_fail, expected|
|
312
312
|
last_command_started.stop
|
313
313
|
|
314
|
-
if pass_fail ==
|
314
|
+
if pass_fail == "pass"
|
315
315
|
expect(last_command_stopped).to be_successfully_executed
|
316
316
|
else
|
317
317
|
expect(last_command_stopped).not_to be_successfully_executed
|
@@ -323,7 +323,7 @@ end
|
|
323
323
|
Then(/^it should (pass|fail) with:$/) do |pass_fail, expected|
|
324
324
|
last_command_started.stop
|
325
325
|
|
326
|
-
if pass_fail ==
|
326
|
+
if pass_fail == "pass"
|
327
327
|
expect(last_command_stopped).to be_successfully_executed
|
328
328
|
else
|
329
329
|
expect(last_command_stopped).not_to be_successfully_executed
|
@@ -335,7 +335,7 @@ end
|
|
335
335
|
Then(/^it should not (pass|fail) with exactly:$/) do |pass_fail, expected|
|
336
336
|
last_command_started.stop
|
337
337
|
|
338
|
-
if pass_fail ==
|
338
|
+
if pass_fail == "pass"
|
339
339
|
expect(last_command_stopped).to be_successfully_executed
|
340
340
|
else
|
341
341
|
expect(last_command_stopped).not_to be_successfully_executed
|
@@ -347,7 +347,7 @@ end
|
|
347
347
|
Then(/^it should (pass|fail) with exactly:$/) do |pass_fail, expected|
|
348
348
|
last_command_started.stop
|
349
349
|
|
350
|
-
if pass_fail ==
|
350
|
+
if pass_fail == "pass"
|
351
351
|
expect(last_command_stopped).to be_successfully_executed
|
352
352
|
else
|
353
353
|
expect(last_command_stopped).not_to be_successfully_executed
|
@@ -359,7 +359,7 @@ end
|
|
359
359
|
Then(/^it should not (pass|fail) (?:with regexp?|matching):$/) do |pass_fail, expected|
|
360
360
|
last_command_started.stop
|
361
361
|
|
362
|
-
if pass_fail ==
|
362
|
+
if pass_fail == "pass"
|
363
363
|
expect(last_command_stopped).to be_successfully_executed
|
364
364
|
else
|
365
365
|
expect(last_command_stopped).not_to be_successfully_executed
|
@@ -371,7 +371,7 @@ end
|
|
371
371
|
Then(/^it should (pass|fail) (?:with regexp?|matching):$/) do |pass_fail, expected|
|
372
372
|
last_command_started.stop
|
373
373
|
|
374
|
-
if pass_fail ==
|
374
|
+
if pass_fail == "pass"
|
375
375
|
expect(last_command_stopped).to be_successfully_executed
|
376
376
|
else
|
377
377
|
expect(last_command_stopped).not_to be_successfully_executed
|
@@ -382,9 +382,9 @@ end
|
|
382
382
|
|
383
383
|
Then(/^(?:the )?(output|stderr|stdout) should not contain anything$/) do |channel|
|
384
384
|
matcher = case channel
|
385
|
-
when
|
386
|
-
when
|
387
|
-
when
|
385
|
+
when "output"; then :have_output
|
386
|
+
when "stderr"; then :have_output_on_stderr
|
387
|
+
when "stdout"; then :have_output_on_stdout
|
388
388
|
end
|
389
389
|
|
390
390
|
expect(all_commands).to include_an_object send(matcher, be_nil.or(be_empty))
|
@@ -394,9 +394,9 @@ Then(/^(?:the )?(output|stdout|stderr) should( not)? contain all of these lines:
|
|
394
394
|
do |channel, negated, table|
|
395
395
|
table.raw.flatten.each do |expected|
|
396
396
|
_matcher = case channel
|
397
|
-
when
|
398
|
-
when
|
399
|
-
when
|
397
|
+
when "output"; then :have_output
|
398
|
+
when "stderr"; then :have_output_on_stderr
|
399
|
+
when "stdout"; then :have_output_on_stdout
|
400
400
|
end
|
401
401
|
|
402
402
|
# TODO: This isn't actually using the above. It's hardcoded to use have_output only
|
@@ -440,5 +440,5 @@ When(/^I send the signal "([^"]*)" to the command (?:"([^"]*)"|(?:started last))
|
|
440
440
|
end
|
441
441
|
|
442
442
|
Given(/^I look for executables in "(.*)" within the current directory$/) do |directory|
|
443
|
-
prepend_environment_variable
|
443
|
+
prepend_environment_variable "PATH", expand_path(directory) + File::PATH_SEPARATOR
|
444
444
|
end
|