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/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
|
@@ -17,69 +17,59 @@ module Aruba
|
|
17
17
|
#
|
18
18
|
# This defines the configuration options of aruba
|
19
19
|
class Configuration < BasicConfiguration
|
20
|
-
option_reader :root_directory,
|
20
|
+
option_reader :root_directory, type: String, default: Dir.getwd
|
21
21
|
|
22
22
|
option_accessor :working_directory,
|
23
|
-
|
24
|
-
|
25
|
-
default: 'tmp/aruba'
|
23
|
+
type: Aruba::Contracts::RelativePath,
|
24
|
+
default: "tmp/aruba"
|
26
25
|
|
27
|
-
option_reader :fixtures_path_prefix,
|
26
|
+
option_reader :fixtures_path_prefix, type: String, default: "%"
|
28
27
|
|
29
|
-
option_accessor :exit_timeout,
|
30
|
-
option_accessor :stop_signal,
|
31
|
-
option_accessor :io_wait_timeout,
|
32
|
-
option_accessor :startup_wait_time,
|
28
|
+
option_accessor :exit_timeout, type: Num, default: 15
|
29
|
+
option_accessor :stop_signal, type: Maybe[String], default: nil
|
30
|
+
option_accessor :io_wait_timeout, type: Num, default: 0.1
|
31
|
+
option_accessor :startup_wait_time, type: Num, default: 0
|
33
32
|
option_accessor :fixtures_directories,
|
34
|
-
|
33
|
+
type: ArrayOf[String],
|
35
34
|
default: %w(features/fixtures spec/fixtures test/fixtures fixtures)
|
36
35
|
|
37
|
-
option_accessor :command_runtime_environment,
|
36
|
+
option_accessor :command_runtime_environment, type: Hash, default: {}
|
38
37
|
option_accessor :command_search_paths,
|
39
|
-
|
40
|
-
[File.join(config.root_directory.value,
|
41
|
-
File.join(config.root_directory.value,
|
38
|
+
type: ArrayOf[String] do |config|
|
39
|
+
[File.join(config.root_directory.value, "bin"),
|
40
|
+
File.join(config.root_directory.value, "exe")]
|
42
41
|
end
|
43
|
-
option_accessor :remove_ansi_escape_sequences,
|
42
|
+
option_accessor :remove_ansi_escape_sequences, type: Bool, default: true
|
44
43
|
option_accessor :command_launcher,
|
45
|
-
|
46
|
-
Aruba::Contracts::Enum[:in_process, :spawn, :debug] =>
|
47
|
-
Aruba::Contracts::Enum[:in_process, :spawn, :debug]
|
48
|
-
},
|
44
|
+
type: Aruba::Contracts::Enum[:in_process, :spawn, :debug],
|
49
45
|
default: :spawn
|
50
|
-
option_accessor :main_class,
|
46
|
+
option_accessor :main_class, type: Maybe[Class], default: nil
|
51
47
|
|
52
48
|
option_accessor :home_directory,
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
File.join(config.root_directory.value, config.working_directory.value)
|
58
|
-
end
|
49
|
+
type: Or[Aruba::Contracts::AbsolutePath,
|
50
|
+
Aruba::Contracts::RelativePath] do |config|
|
51
|
+
File.join(config.root_directory.value, config.working_directory.value)
|
52
|
+
end
|
59
53
|
|
60
54
|
option_accessor :log_level,
|
61
|
-
|
62
|
-
Aruba::Contracts::Enum[:fatal, :warn, :debug, :info,
|
63
|
-
:error, :unknown, :silent] =>
|
55
|
+
type:
|
64
56
|
Aruba::Contracts::Enum[:fatal, :warn, :debug, :info,
|
65
|
-
:error, :unknown, :silent]
|
66
|
-
},
|
57
|
+
:error, :unknown, :silent],
|
67
58
|
default: :info
|
68
59
|
|
69
60
|
# TODO: deprecate this value and replace with "filesystem allocation unit"
|
70
61
|
# equal to 4096 by default. "filesystem allocation unit" would represent
|
71
62
|
# the actual MINIMUM space taken in bytes by a 1-byte file
|
72
63
|
option_accessor :physical_block_size,
|
73
|
-
|
74
|
-
Aruba::Contracts::IsPowerOfTwo },
|
64
|
+
type: Aruba::Contracts::IsPowerOfTwo,
|
75
65
|
default: 512
|
76
|
-
option_accessor :console_history_file,
|
77
|
-
default:
|
66
|
+
option_accessor :console_history_file, type: String,
|
67
|
+
default: "~/.aruba_history"
|
78
68
|
|
79
69
|
option_accessor :activate_announcer_on_command_failure,
|
80
|
-
|
70
|
+
type: ArrayOf[Symbol],
|
81
71
|
default: []
|
82
|
-
option_accessor :allow_absolute_paths,
|
72
|
+
option_accessor :allow_absolute_paths, type: Bool, default: false
|
83
73
|
end
|
84
74
|
end
|
85
75
|
|
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
|
@@ -8,10 +8,10 @@ module Aruba
|
|
8
8
|
module Help
|
9
9
|
# Output help information
|
10
10
|
def aruba_help
|
11
|
-
puts
|
12
|
-
puts
|
13
|
-
puts
|
14
|
-
puts
|
11
|
+
puts "Aruba Version: #{Aruba::VERSION}"
|
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,10 +20,10 @@ 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
|
-
puts "Available Methods:\n
|
26
|
+
puts "Available Methods:\n#{ms.join("\n")}"
|
27
27
|
|
28
28
|
nil
|
29
29
|
end
|
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
|
@@ -88,30 +88,22 @@ end
|
|
88
88
|
|
89
89
|
When(/^I wait for (?:output|stdout) to contain:$/) do |expected|
|
90
90
|
Timeout.timeout(aruba.config.exit_timeout) do
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
retry
|
97
|
-
end
|
98
|
-
|
99
|
-
break
|
91
|
+
begin
|
92
|
+
expect(last_command_started).to have_output an_output_string_including(expected)
|
93
|
+
rescue ExpectationError
|
94
|
+
sleep 0.1
|
95
|
+
retry
|
100
96
|
end
|
101
97
|
end
|
102
98
|
end
|
103
99
|
|
104
100
|
When(/^I wait for (?:output|stdout) to contain "([^"]*)"$/) do |expected|
|
105
101
|
Timeout.timeout(aruba.config.exit_timeout) do
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
retry
|
112
|
-
end
|
113
|
-
|
114
|
-
break
|
102
|
+
begin
|
103
|
+
expect(last_command_started).to have_output an_output_string_including(expected)
|
104
|
+
rescue ExpectationError
|
105
|
+
sleep 0.1
|
106
|
+
retry
|
115
107
|
end
|
116
108
|
end
|
117
109
|
end
|
@@ -143,9 +135,9 @@ Then(
|
|
143
135
|
/^(?:the )?(output|stderr|stdout) from "([^"]*)" should contain( exactly)? "([^"]*)"$/
|
144
136
|
) do |channel, cmd, exactly, expected|
|
145
137
|
matcher = case channel
|
146
|
-
when
|
147
|
-
when
|
148
|
-
when
|
138
|
+
when "output"; then :have_output
|
139
|
+
when "stderr"; then :have_output_on_stderr
|
140
|
+
when "stdout"; then :have_output_on_stdout
|
149
141
|
end
|
150
142
|
|
151
143
|
command = aruba.command_monitor.find(Aruba.platform.detect_ruby(cmd))
|
@@ -164,9 +156,9 @@ Then(
|
|
164
156
|
/^(?:the )?(output|stderr|stdout) from "([^"]*)" should not contain( exactly)? "([^"]*)"$/
|
165
157
|
) do |channel, cmd, exactly, expected|
|
166
158
|
matcher = case channel
|
167
|
-
when
|
168
|
-
when
|
169
|
-
when
|
159
|
+
when "output"; then :have_output
|
160
|
+
when "stderr"; then :have_output_on_stderr
|
161
|
+
when "stdout"; then :have_output_on_stdout
|
170
162
|
end
|
171
163
|
|
172
164
|
command = aruba.command_monitor.find(Aruba.platform.detect_ruby(cmd))
|
@@ -212,9 +204,9 @@ end
|
|
212
204
|
Then(/^(?:the )?(output|stderr|stdout) from "([^"]*)" should not contain( exactly)?:$/) \
|
213
205
|
do |channel, cmd, exactly, expected|
|
214
206
|
matcher = case channel
|
215
|
-
when
|
216
|
-
when
|
217
|
-
when
|
207
|
+
when "output"; then :have_output
|
208
|
+
when "stderr"; then :have_output_on_stderr
|
209
|
+
when "stdout"; then :have_output_on_stdout
|
218
210
|
end
|
219
211
|
|
220
212
|
command = aruba.command_monitor.find(Aruba.platform.detect_ruby(cmd))
|
@@ -232,9 +224,9 @@ end
|
|
232
224
|
Then(/^(?:the )?(output|stderr|stdout) from "([^"]*)" should contain( exactly)?:$/) \
|
233
225
|
do |channel, cmd, exactly, expected|
|
234
226
|
matcher = case channel
|
235
|
-
when
|
236
|
-
when
|
237
|
-
when
|
227
|
+
when "output"; then :have_output
|
228
|
+
when "stderr"; then :have_output_on_stderr
|
229
|
+
when "stdout"; then :have_output_on_stdout
|
238
230
|
end
|
239
231
|
|
240
232
|
command = aruba.command_monitor.find(Aruba.platform.detect_ruby(cmd))
|
@@ -295,7 +287,7 @@ end
|
|
295
287
|
Then(/^it should not (pass|fail) with "(.*?)"$/) do |pass_fail, expected|
|
296
288
|
last_command_started.stop
|
297
289
|
|
298
|
-
if pass_fail ==
|
290
|
+
if pass_fail == "pass"
|
299
291
|
expect(last_command_stopped).to be_successfully_executed
|
300
292
|
else
|
301
293
|
expect(last_command_stopped).not_to be_successfully_executed
|
@@ -307,7 +299,7 @@ end
|
|
307
299
|
Then(/^it should (pass|fail) with "(.*?)"$/) do |pass_fail, expected|
|
308
300
|
last_command_started.stop
|
309
301
|
|
310
|
-
if pass_fail ==
|
302
|
+
if pass_fail == "pass"
|
311
303
|
expect(last_command_stopped).to be_successfully_executed
|
312
304
|
else
|
313
305
|
expect(last_command_stopped).not_to be_successfully_executed
|
@@ -319,7 +311,7 @@ end
|
|
319
311
|
Then(/^it should not (pass|fail) with:$/) do |pass_fail, expected|
|
320
312
|
last_command_started.stop
|
321
313
|
|
322
|
-
if pass_fail ==
|
314
|
+
if pass_fail == "pass"
|
323
315
|
expect(last_command_stopped).to be_successfully_executed
|
324
316
|
else
|
325
317
|
expect(last_command_stopped).not_to be_successfully_executed
|
@@ -331,7 +323,7 @@ end
|
|
331
323
|
Then(/^it should (pass|fail) with:$/) do |pass_fail, expected|
|
332
324
|
last_command_started.stop
|
333
325
|
|
334
|
-
if pass_fail ==
|
326
|
+
if pass_fail == "pass"
|
335
327
|
expect(last_command_stopped).to be_successfully_executed
|
336
328
|
else
|
337
329
|
expect(last_command_stopped).not_to be_successfully_executed
|
@@ -343,7 +335,7 @@ end
|
|
343
335
|
Then(/^it should not (pass|fail) with exactly:$/) do |pass_fail, expected|
|
344
336
|
last_command_started.stop
|
345
337
|
|
346
|
-
if pass_fail ==
|
338
|
+
if pass_fail == "pass"
|
347
339
|
expect(last_command_stopped).to be_successfully_executed
|
348
340
|
else
|
349
341
|
expect(last_command_stopped).not_to be_successfully_executed
|
@@ -355,7 +347,7 @@ end
|
|
355
347
|
Then(/^it should (pass|fail) with exactly:$/) do |pass_fail, expected|
|
356
348
|
last_command_started.stop
|
357
349
|
|
358
|
-
if pass_fail ==
|
350
|
+
if pass_fail == "pass"
|
359
351
|
expect(last_command_stopped).to be_successfully_executed
|
360
352
|
else
|
361
353
|
expect(last_command_stopped).not_to be_successfully_executed
|
@@ -367,7 +359,7 @@ end
|
|
367
359
|
Then(/^it should not (pass|fail) (?:with regexp?|matching):$/) do |pass_fail, expected|
|
368
360
|
last_command_started.stop
|
369
361
|
|
370
|
-
if pass_fail ==
|
362
|
+
if pass_fail == "pass"
|
371
363
|
expect(last_command_stopped).to be_successfully_executed
|
372
364
|
else
|
373
365
|
expect(last_command_stopped).not_to be_successfully_executed
|
@@ -379,7 +371,7 @@ end
|
|
379
371
|
Then(/^it should (pass|fail) (?:with regexp?|matching):$/) do |pass_fail, expected|
|
380
372
|
last_command_started.stop
|
381
373
|
|
382
|
-
if pass_fail ==
|
374
|
+
if pass_fail == "pass"
|
383
375
|
expect(last_command_stopped).to be_successfully_executed
|
384
376
|
else
|
385
377
|
expect(last_command_stopped).not_to be_successfully_executed
|
@@ -390,9 +382,9 @@ end
|
|
390
382
|
|
391
383
|
Then(/^(?:the )?(output|stderr|stdout) should not contain anything$/) do |channel|
|
392
384
|
matcher = case channel
|
393
|
-
when
|
394
|
-
when
|
395
|
-
when
|
385
|
+
when "output"; then :have_output
|
386
|
+
when "stderr"; then :have_output_on_stderr
|
387
|
+
when "stdout"; then :have_output_on_stdout
|
396
388
|
end
|
397
389
|
|
398
390
|
expect(all_commands).to include_an_object send(matcher, be_nil.or(be_empty))
|
@@ -402,9 +394,9 @@ Then(/^(?:the )?(output|stdout|stderr) should( not)? contain all of these lines:
|
|
402
394
|
do |channel, negated, table|
|
403
395
|
table.raw.flatten.each do |expected|
|
404
396
|
_matcher = case channel
|
405
|
-
when
|
406
|
-
when
|
407
|
-
when
|
397
|
+
when "output"; then :have_output
|
398
|
+
when "stderr"; then :have_output_on_stderr
|
399
|
+
when "stdout"; then :have_output_on_stdout
|
408
400
|
end
|
409
401
|
|
410
402
|
# TODO: This isn't actually using the above. It's hardcoded to use have_output only
|
@@ -448,5 +440,5 @@ When(/^I send the signal "([^"]*)" to the command (?:"([^"]*)"|(?:started last))
|
|
448
440
|
end
|
449
441
|
|
450
442
|
Given(/^I look for executables in "(.*)" within the current directory$/) do |directory|
|
451
|
-
prepend_environment_variable
|
443
|
+
prepend_environment_variable "PATH", expand_path(directory) + File::PATH_SEPARATOR
|
452
444
|
end
|