aruba 1.0.4 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -1
  3. data/CONTRIBUTING.md +11 -23
  4. data/README.md +1 -2
  5. data/exe/aruba +2 -2
  6. data/lib/aruba.rb +1 -1
  7. data/lib/aruba/api.rb +11 -11
  8. data/lib/aruba/api/bundler.rb +1 -1
  9. data/lib/aruba/api/commands.rb +7 -7
  10. data/lib/aruba/api/core.rb +20 -20
  11. data/lib/aruba/api/environment.rb +2 -2
  12. data/lib/aruba/api/filesystem.rb +41 -14
  13. data/lib/aruba/api/text.rb +4 -4
  14. data/lib/aruba/aruba_path.rb +2 -2
  15. data/lib/aruba/basic_configuration.rb +11 -11
  16. data/lib/aruba/cli.rb +7 -7
  17. data/lib/aruba/command.rb +4 -4
  18. data/lib/aruba/config/jruby.rb +9 -9
  19. data/lib/aruba/config_wrapper.rb +2 -2
  20. data/lib/aruba/configuration.rb +14 -14
  21. data/lib/aruba/console.rb +11 -11
  22. data/lib/aruba/console/help.rb +5 -5
  23. data/lib/aruba/contracts/absolute_path.rb +1 -1
  24. data/lib/aruba/contracts/enum.rb +1 -1
  25. data/lib/aruba/contracts/is_power_of_two.rb +1 -1
  26. data/lib/aruba/contracts/relative_path.rb +1 -1
  27. data/lib/aruba/cucumber.rb +7 -7
  28. data/lib/aruba/cucumber/command.rb +31 -31
  29. data/lib/aruba/cucumber/environment.rb +7 -7
  30. data/lib/aruba/cucumber/file.rb +7 -3
  31. data/lib/aruba/cucumber/hooks.rb +29 -29
  32. data/lib/aruba/cucumber/testing_frameworks.rb +18 -18
  33. data/lib/aruba/event_bus.rb +4 -4
  34. data/lib/aruba/event_bus/name_resolver.rb +4 -4
  35. data/lib/aruba/file_size.rb +1 -1
  36. data/lib/aruba/generators/script_file.rb +2 -2
  37. data/lib/aruba/in_config_wrapper.rb +1 -1
  38. data/lib/aruba/initializer.rb +10 -10
  39. data/lib/aruba/matchers/base/base_matcher.rb +1 -1
  40. data/lib/aruba/matchers/base/message_indenter.rb +1 -1
  41. data/lib/aruba/matchers/base/object_formatter.rb +2 -2
  42. data/lib/aruba/matchers/collection.rb +1 -1
  43. data/lib/aruba/matchers/collection/all.rb +1 -1
  44. data/lib/aruba/matchers/collection/include_an_object.rb +2 -2
  45. data/lib/aruba/matchers/command.rb +1 -1
  46. data/lib/aruba/matchers/command/be_successfully_executed.rb +4 -4
  47. data/lib/aruba/matchers/command/have_finished_in_time.rb +1 -1
  48. data/lib/aruba/matchers/command/have_output.rb +1 -1
  49. data/lib/aruba/matchers/directory.rb +1 -1
  50. data/lib/aruba/matchers/directory/be_an_existing_directory.rb +2 -2
  51. data/lib/aruba/matchers/directory/have_sub_directory.rb +3 -3
  52. data/lib/aruba/matchers/environment.rb +1 -1
  53. data/lib/aruba/matchers/file.rb +1 -1
  54. data/lib/aruba/matchers/file/be_a_command_found_in_path.rb +1 -1
  55. data/lib/aruba/matchers/file/be_an_existing_executable.rb +2 -2
  56. data/lib/aruba/matchers/file/be_an_existing_file.rb +2 -2
  57. data/lib/aruba/matchers/file/have_file_content.rb +1 -1
  58. data/lib/aruba/matchers/file/have_file_size.rb +1 -1
  59. data/lib/aruba/matchers/file/have_same_file_content.rb +2 -2
  60. data/lib/aruba/matchers/path.rb +1 -1
  61. data/lib/aruba/matchers/path/a_path_matching_pattern.rb +1 -1
  62. data/lib/aruba/matchers/path/be_an_absolute_path.rb +1 -1
  63. data/lib/aruba/matchers/path/be_an_existing_path.rb +1 -1
  64. data/lib/aruba/matchers/path/have_permissions.rb +2 -2
  65. data/lib/aruba/matchers/string.rb +1 -1
  66. data/lib/aruba/matchers/string/include_output_string.rb +1 -1
  67. data/lib/aruba/matchers/string/match_output_string.rb +1 -1
  68. data/lib/aruba/matchers/string/output_string_eq.rb +1 -1
  69. data/lib/aruba/platform.rb +2 -2
  70. data/lib/aruba/platforms/announcer.rb +14 -14
  71. data/lib/aruba/platforms/aruba_fixed_size_file_creator.rb +1 -1
  72. data/lib/aruba/platforms/aruba_logger.rb +1 -1
  73. data/lib/aruba/platforms/command_monitor.rb +5 -5
  74. data/lib/aruba/platforms/determine_disk_usage.rb +1 -1
  75. data/lib/aruba/platforms/filesystem_status.rb +1 -1
  76. data/lib/aruba/platforms/simple_table.rb +1 -1
  77. data/lib/aruba/platforms/unix_command_string.rb +2 -2
  78. data/lib/aruba/platforms/unix_platform.rb +22 -22
  79. data/lib/aruba/platforms/unix_which.rb +1 -1
  80. data/lib/aruba/platforms/windows_command_string.rb +2 -2
  81. data/lib/aruba/platforms/windows_environment_variables.rb +1 -1
  82. data/lib/aruba/platforms/windows_platform.rb +6 -6
  83. data/lib/aruba/platforms/windows_which.rb +5 -5
  84. data/lib/aruba/processes/basic_process.rb +2 -2
  85. data/lib/aruba/processes/debug_process.rb +5 -5
  86. data/lib/aruba/processes/in_process.rb +7 -7
  87. data/lib/aruba/processes/spawn_process.rb +17 -22
  88. data/lib/aruba/rspec.rb +6 -6
  89. data/lib/aruba/runtime.rb +6 -6
  90. data/lib/aruba/setup.rb +3 -3
  91. data/lib/aruba/version.rb +1 -1
  92. metadata +21 -22
  93. data/lib/aruba/tasks/docker_helpers.rb +0 -156
@@ -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? '<pid-last-command-started>'
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
 
@@ -1,4 +1,4 @@
1
- require 'pathname'
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 'contracts'
2
- require 'aruba/basic_configuration/option'
3
- require 'aruba/in_config_wrapper'
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, 'Either use block or default value' if block_given? && default
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, 'Either use block or default value' if block_given? && default
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('%s_%s', 'before_', name.to_s).to_sym
114
- raise ArgumentError, 'A block is required' unless block
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('%s_%s', 'before_', name.to_s).to_sym
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('%s_%s', 'after_', name.to_s).to_sym
146
- raise ArgumentError, 'A block is required' unless block
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('%s_%s', 'after_', name.to_s).to_sym
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 'thor'
2
- require 'aruba/console'
3
- require 'aruba/initializer'
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 'console', "Start aruba's console"
15
+ desc "console", "Start aruba's console"
16
16
  def console
17
17
  Aruba::Console.new.start
18
18
  end
19
19
 
20
- desc 'init', 'Initialize aruba'
20
+ desc "init", "Initialize aruba"
21
21
  option :test_framework,
22
- default: 'cucumber',
22
+ default: "cucumber",
23
23
  enum: %w(cucumber rspec minitest),
24
- desc: 'Choose which test framework to use'
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 'delegate'
2
- require 'aruba/processes/spawn_process'
3
- require 'aruba/processes/in_process'
4
- require 'aruba/processes/debug_process'
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
@@ -1,27 +1,27 @@
1
- require 'rbconfig'
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 == 'java'
6
+ next unless RUBY_PLATFORM == "java"
7
7
 
8
8
  env = command.environment
9
9
 
10
- jruby_opts = env['JRUBY_OPTS'] || ''
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? '-X-C'
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? '--dev'
16
+ jruby_opts = "--dev #{jruby_opts}" unless jruby_opts.include? "--dev"
17
17
 
18
- env['JRUBY_OPTS'] = jruby_opts
18
+ env["JRUBY_OPTS"] = jruby_opts
19
19
 
20
- if /solaris|sunos/i.match?(RbConfig::CONFIG['host_os'])
21
- java_opts = env['JAVA_OPTS'] || ''
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['JAVA_OPTS'] = "-d32 #{java_opts}" unless java_opts.include?('-d32')
24
+ env["JAVA_OPTS"] = "-d32 #{java_opts}" unless java_opts.include?("-d32")
25
25
  end
26
26
  end
27
27
  end
@@ -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
  )
@@ -1,15 +1,15 @@
1
- require 'contracts'
1
+ require "contracts"
2
2
 
3
- require 'aruba/version'
4
- require 'aruba/basic_configuration'
5
- require 'aruba/in_config_wrapper'
6
- require 'aruba/hooks'
3
+ require "aruba/version"
4
+ require "aruba/basic_configuration"
5
+ require "aruba/in_config_wrapper"
6
+ require "aruba/hooks"
7
7
 
8
- require 'aruba/contracts/relative_path'
9
- require 'aruba/contracts/absolute_path'
10
- require 'aruba/contracts/enum'
8
+ require "aruba/contracts/relative_path"
9
+ require "aruba/contracts/absolute_path"
10
+ require "aruba/contracts/enum"
11
11
 
12
- require 'aruba/contracts/is_power_of_two'
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: 'tmp/aruba'
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, 'bin'),
40
- File.join(config.root_directory.value, 'exe')]
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: '~/.aruba_history'
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 'irb'
1
+ require "irb"
2
2
 
3
- require 'aruba/api'
4
- require 'aruba/console/help'
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] = 'aruba'
18
+ IRB.conf[:IRB_NAME] = "aruba"
19
19
 
20
20
  IRB.conf[:PROMPT] = {}
21
21
  IRB.conf[:PROMPT][:ARUBA] = {
22
- PROMPT_I: '%N:%03n:%i> ',
23
- PROMPT_S: '%N:%03n:%i%l ',
24
- PROMPT_C: '%N:%03n:%i* ',
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 'irb/completion'
32
- require 'irb/ext/save-history'
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
- 'nil'
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('SIGINT') do
53
+ trap("SIGINT") do
54
54
  irb.signal_handle
55
55
  end
56
56
 
@@ -1,4 +1,4 @@
1
- require 'aruba/api'
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 'Issue Tracker: https://github.com/cucumber/aruba/issues'
13
- puts 'Documentation:'
14
- puts '* http://www.rubydoc.info/gems/aruba'
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('* %s', e) }
23
+ .each_with_object([]) { |e, a| a << format("* %s", e) }
24
24
  .sort
25
25
 
26
26
  puts "Available Methods:\n#{ms.join("\n")}"
@@ -1,4 +1,4 @@
1
- require 'aruba/platform'
1
+ require "aruba/platform"
2
2
 
3
3
  # Aruba
4
4
  module Aruba
@@ -1,4 +1,4 @@
1
- require 'contracts'
1
+ require "contracts"
2
2
 
3
3
  # Aruba
4
4
  module Aruba
@@ -1,4 +1,4 @@
1
- require 'aruba/aruba_path'
1
+ require "aruba/aruba_path"
2
2
 
3
3
  # Aruba
4
4
  module Aruba
@@ -1,4 +1,4 @@
1
- require 'aruba/platform'
1
+ require "aruba/platform"
2
2
 
3
3
  # Aruba
4
4
  module Aruba
@@ -1,8 +1,8 @@
1
- require 'aruba/version'
1
+ require "aruba/version"
2
2
 
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'
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 'aruba/generators/script_file'
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('bin/myscript')
17
+ full_path = expand_path("bin/myscript")
18
18
 
19
- Aruba.platform.mkdir(expand_path('bin'))
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 == 'terminate'
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 'output'; then :have_output
139
- when 'stderr'; then :have_output_on_stderr
140
- when 'stdout'; then :have_output_on_stdout
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 'output'; then :have_output
160
- when 'stderr'; then :have_output_on_stderr
161
- when 'stdout'; then :have_output_on_stdout
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 'output'; then :have_output
208
- when 'stderr'; then :have_output_on_stderr
209
- when 'stdout'; then :have_output_on_stdout
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 'output'; then :have_output
228
- when 'stderr'; then :have_output_on_stderr
229
- when 'stdout'; then :have_output_on_stdout
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 == 'pass'
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 == 'pass'
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 == 'pass'
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 == 'pass'
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 == 'pass'
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 == 'pass'
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 == 'pass'
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 == 'pass'
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 'output'; then :have_output
386
- when 'stderr'; then :have_output_on_stderr
387
- when 'stdout'; then :have_output_on_stdout
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 'output'; then :have_output
398
- when 'stderr'; then :have_output_on_stderr
399
- when 'stdout'; then :have_output_on_stdout
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 'PATH', expand_path(directory) + File::PATH_SEPARATOR
443
+ prepend_environment_variable "PATH", expand_path(directory) + File::PATH_SEPARATOR
444
444
  end