aruba 1.0.0.pre.alpha.2 → 1.0.0.pre.alpha.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +5 -5
  2. data/.github/PULL_REQUEST_TEMPLATE.md +2 -1
  3. data/.rubocop.yml +6 -181
  4. data/.rubocop_todo.yml +364 -0
  5. data/.travis.yml +63 -34
  6. data/.yardopts +3 -0
  7. data/CHANGELOG.md +1121 -0
  8. data/CONTRIBUTING.md +179 -78
  9. data/Gemfile +29 -44
  10. data/README.md +41 -11
  11. data/Rakefile +35 -35
  12. data/appveyor.yml +6 -5
  13. data/aruba.gemspec +14 -16
  14. data/bin/console +2 -11
  15. data/cucumber.yml +0 -7
  16. data/fixtures/cli-app/README.md +1 -1
  17. data/fixtures/cli-app/Rakefile +1 -1
  18. data/fixtures/cli-app/cli-app.gemspec +1 -0
  19. data/fixtures/cli-app/lib/cli/app/suppress_simple_cov_output.rb +3 -3
  20. data/fixtures/cli-app/lib/cli/app/version.rb +1 -1
  21. data/fixtures/empty-app/Rakefile +1 -1
  22. data/fixtures/empty-app/cli-app.gemspec +1 -0
  23. data/fixtures/empty-app/lib/cli/app/version.rb +1 -1
  24. data/fixtures/getting-started-app/Gemfile +1 -1
  25. data/lib/aruba/api.rb +3 -10
  26. data/lib/aruba/api/bundler.rb +16 -0
  27. data/lib/aruba/api/commands.rb +249 -0
  28. data/lib/aruba/api/core.rb +24 -10
  29. data/lib/aruba/api/environment.rb +12 -7
  30. data/lib/aruba/api/filesystem.rb +22 -20
  31. data/lib/aruba/api/text.rb +3 -9
  32. data/lib/aruba/aruba_path.rb +3 -18
  33. data/lib/aruba/basic_configuration.rb +3 -19
  34. data/lib/aruba/cli.rb +1 -1
  35. data/lib/aruba/colorizer.rb +33 -33
  36. data/lib/aruba/command.rb +4 -0
  37. data/lib/aruba/config_wrapper.rb +1 -1
  38. data/lib/aruba/configuration.rb +78 -0
  39. data/lib/aruba/console.rb +5 -5
  40. data/lib/aruba/console/help.rb +1 -1
  41. data/lib/aruba/cucumber.rb +0 -1
  42. data/lib/aruba/cucumber/command.rb +55 -115
  43. data/lib/aruba/cucumber/environment.rb +1 -1
  44. data/lib/aruba/cucumber/file.rb +9 -21
  45. data/lib/aruba/cucumber/hooks.rb +6 -62
  46. data/lib/aruba/event_bus/name_resolver.rb +1 -2
  47. data/lib/aruba/hooks.rb +1 -1
  48. data/lib/aruba/initializer.rb +3 -3
  49. data/lib/aruba/matchers/base/base_matcher.rb +2 -2
  50. data/lib/aruba/matchers/base/message_indenter.rb +19 -0
  51. data/lib/aruba/matchers/base/object_formatter.rb +2 -2
  52. data/lib/aruba/matchers/collection/include_an_object.rb +7 -9
  53. data/lib/aruba/matchers/command/be_successfully_executed.rb +2 -4
  54. data/lib/aruba/matchers/command/have_exit_status.rb +1 -1
  55. data/lib/aruba/matchers/command/have_finished_in_time.rb +2 -4
  56. data/lib/aruba/matchers/command/have_output.rb +9 -4
  57. data/lib/aruba/matchers/command/have_output_on_stderr.rb +1 -1
  58. data/lib/aruba/matchers/command/have_output_on_stdout.rb +1 -1
  59. data/lib/aruba/matchers/command/have_output_size.rb +1 -1
  60. data/lib/aruba/matchers/directory/be_an_existing_directory.rb +4 -6
  61. data/lib/aruba/matchers/directory/have_sub_directory.rb +4 -6
  62. data/lib/aruba/matchers/file/be_a_command_found_in_path.rb +2 -4
  63. data/lib/aruba/matchers/file/be_an_existing_executable.rb +4 -6
  64. data/lib/aruba/matchers/file/be_an_existing_file.rb +4 -6
  65. data/lib/aruba/matchers/file/have_file_content.rb +4 -4
  66. data/lib/aruba/matchers/file/have_file_size.rb +6 -8
  67. data/lib/aruba/matchers/file/have_same_file_content.rb +9 -12
  68. data/lib/aruba/matchers/path/a_path_matching_pattern.rb +2 -4
  69. data/lib/aruba/matchers/path/be_an_absolute_path.rb +3 -5
  70. data/lib/aruba/matchers/path/be_an_existing_path.rb +4 -6
  71. data/lib/aruba/matchers/path/have_permissions.rb +6 -8
  72. data/lib/aruba/matchers/string/include_output_string.rb +8 -10
  73. data/lib/aruba/matchers/string/match_output_string.rb +9 -11
  74. data/lib/aruba/matchers/string/output_string_eq.rb +7 -9
  75. data/lib/aruba/platform.rb +0 -1
  76. data/lib/aruba/platforms/announcer.rb +26 -70
  77. data/lib/aruba/platforms/aruba_file_creator.rb +1 -1
  78. data/lib/aruba/platforms/aruba_fixed_size_file_creator.rb +2 -2
  79. data/lib/aruba/platforms/aruba_logger.rb +22 -2
  80. data/lib/aruba/platforms/command_monitor.rb +2 -125
  81. data/lib/aruba/platforms/filesystem_status.rb +9 -9
  82. data/lib/aruba/platforms/local_environment.rb +2 -2
  83. data/lib/aruba/platforms/simple_table.rb +3 -3
  84. data/lib/aruba/platforms/unix_command_string.rb +7 -4
  85. data/lib/aruba/platforms/unix_environment_variables.rb +9 -13
  86. data/lib/aruba/platforms/unix_platform.rb +2 -27
  87. data/lib/aruba/platforms/unix_which.rb +2 -1
  88. data/lib/aruba/platforms/windows_command_string.rb +20 -7
  89. data/lib/aruba/platforms/windows_environment_variables.rb +35 -30
  90. data/lib/aruba/platforms/windows_which.rb +4 -3
  91. data/lib/aruba/processes/basic_process.rb +11 -15
  92. data/lib/aruba/processes/debug_process.rb +5 -0
  93. data/lib/aruba/processes/in_process.rb +17 -8
  94. data/lib/aruba/processes/spawn_process.rb +35 -23
  95. data/lib/aruba/rspec.rb +9 -22
  96. data/lib/aruba/runtime.rb +7 -5
  97. data/lib/aruba/setup.rb +6 -4
  98. data/lib/aruba/tasks/docker_helpers.rb +1 -1
  99. data/lib/aruba/version.rb +1 -1
  100. metadata +37 -57
  101. data/History.md +0 -612
  102. data/bin/bootstrap +0 -34
  103. data/fixtures/spawn_process/stderr.sh +0 -3
  104. data/lib/aruba/api/command.rb +0 -309
  105. data/lib/aruba/api/deprecated.rb +0 -895
  106. data/lib/aruba/api/rvm.rb +0 -44
  107. data/lib/aruba/config.rb +0 -101
  108. data/lib/aruba/cucumber/rvm.rb +0 -3
  109. data/lib/aruba/in_process.rb +0 -14
  110. data/lib/aruba/jruby.rb +0 -4
  111. data/lib/aruba/matchers/path/match_path_pattern.rb +0 -41
  112. data/lib/aruba/matchers/rspec_matcher_include_regexp.rb +0 -25
  113. data/lib/aruba/spawn_process.rb +0 -11
@@ -5,44 +5,35 @@ module Aruba
5
5
  # Platforms
6
6
  module Platforms
7
7
  # Windows is case-insensitive when it accesses its environment variables.
8
- # That means that at the Windows command line:
9
8
  #
10
- # C:>set Path
11
- # C:>Path=.;.\bin;c:\rubys\ruby-2.1.6-p336\bin;
12
- # C:>set PATH
13
- # C:>Path=.;.\bin;c:\rubys\ruby-2.1.6-p336\bin;
9
+ # To work around this we turn all of the environment variable keys to
10
+ # upper-case so that aruba is ensured that accessing environment variables
11
+ # with upper-case keys will always work. See the following examples.
14
12
  #
15
- # If you access environment variables through ENV, you can access values no
16
- # matter the case of the key:
13
+ # @example Setting Windows environment variables using mixed case
14
+ # C:>set Path
15
+ # C:>Path=.;.\bin;c:\rubys\ruby-2.1.6-p336\bin;
16
+ # C:>set PATH
17
+ # C:>Path=.;.\bin;c:\rubys\ruby-2.1.6-p336\bin;
17
18
  #
18
- # irb: > ENV["Path"]
19
- # => ".;.\bin;c:\rubys\ruby-2.1.6-p336\bin;"
20
- # irb: > ENV["Path"]
21
- # => ".;.\bin;c:\rubys\ruby-2.1.6-p336\bin;"
19
+ # @example If you access environment variables through ENV, you can access values no matter the case of the key:
20
+ # ENV["Path"] # => ".;.\bin;c:\rubys\ruby-2.1.6-p336\bin;"
21
+ # ENV["PATH"] # => ".;.\bin;c:\rubys\ruby-2.1.6-p336\bin;"
22
22
  #
23
- # But if you copy the ENV to a hash, Ruby treats the keys as case sensitive:
24
- #
25
- # irb: > env_copy = ENV.to_hash
26
- # => {"ALLUSERSPROFILE"=>"C:\\ProgramData", "ANSICON"=>"119x1000 (119x58)", "ANSICON_DEF"=>"7", APPDATA"=>"C:\\Users\\blorf\\AppData\\Roaming", ....}
27
- # irb: > env["Path"]
28
- # => ".;.\bin;c:\rubys\ruby-2.1.6-p336\bin;"
29
- # irb: > env["PATH"]
30
- # => nil
31
- #
32
- # Thus we turn all of the environment variable keys to upper case so that
33
- # aruba is ensured that accessing environment variables with upper case keys
34
- # will always work.
23
+ # @example But if you copy the ENV to a hash, Ruby treats the keys as case sensitive:
24
+ # env_copy = ENV.to_hash
25
+ # # => {"ALLUSERSPROFILE"=>"C:\\ProgramData", "ANSICON"=>"119x1000 (119x58)", "ANSICON_DEF"=>"7", APPDATA"=>"C:\\Users\\blorf\\AppData\\Roaming", ....}
26
+ # env["Path"]
27
+ # # => ".;.\bin;c:\rubys\ruby-2.1.6-p336\bin;"
28
+ # env["PATH"]
29
+ # # => nil
35
30
  class WindowsEnvironmentVariables < UnixEnvironmentVariables
36
- def initialize(env = ENV.to_hash)
37
- @actions = []
38
-
39
- @env = env.each_with_object({}) { |(k,v), a| a[k.to_s.upcase] = v }
31
+ def initialize(env = ENV)
32
+ super(upcase_env env)
40
33
  end
41
34
 
42
35
  def update(other_env, &block)
43
- other_env = other_env.each_with_object({}) { |(k,v), a| a[k.to_s.upcase] = v }
44
-
45
- super(other_env, &block)
36
+ super(upcase_env(other_env), &block)
46
37
  end
47
38
 
48
39
  def fetch(name, default = UnixEnvironmentVariables::UNDEFINED)
@@ -72,6 +63,20 @@ module Aruba
72
63
  def delete(name)
73
64
  super(name.upcase)
74
65
  end
66
+
67
+ def self.hash_from_env
68
+ upcase_env(ENV)
69
+ end
70
+
71
+ def self.upcase_env(env)
72
+ env.each_with_object({}) { |(k, v), a| a[k.to_s.upcase] = v }
73
+ end
74
+
75
+ private
76
+
77
+ def upcase_env(env)
78
+ self.class.upcase_env(env)
79
+ end
75
80
  end
76
81
  end
77
82
  end
@@ -23,11 +23,12 @@ module Aruba
23
23
  Aruba.platform.absolute_path?(program) || Aruba.platform.relative_command?(program)
24
24
  end
25
25
 
26
- def call(program, path)
26
+ def call(program, _path)
27
27
  # Expand `#path_exts`
28
28
  found = Dir[program].first
29
29
 
30
30
  return File.expand_path(found) if found && Aruba.platform.executable?(found)
31
+
31
32
  nil
32
33
  end
33
34
  end
@@ -48,7 +49,7 @@ module Aruba
48
49
  file = File.join(dir, program)
49
50
  # Dir[] doesn't handle backslashes properly, so convert them. Also, if
50
51
  # the program name doesn't have an extension, try them all.
51
- file = file.tr("\\", "/")
52
+ file = file.tr('\\', '/')
52
53
 
53
54
  found = Dir[file].first
54
55
 
@@ -95,7 +96,7 @@ module Aruba
95
96
  private
96
97
 
97
98
  def windows_executable_extentions
98
- ENV['PATHEXT'] ? format('.{%s}', ENV['PATHEXT'].tr(';', ',').tr('.','')).downcase : '.{exe,com,bat}'
99
+ ENV['PATHEXT'] ? format('.{%s}', ENV['PATHEXT'].tr(';', ',').tr('.', '')).downcase : '.{exe,com,bat}'
99
100
  end
100
101
  end
101
102
  end
@@ -11,9 +11,12 @@ module Aruba
11
11
  #
12
12
  # @private
13
13
  class BasicProcess
14
- attr_reader :exit_status, :environment, :working_directory, :main_class, :io_wait_timeout, :exit_timeout, :startup_wait_time
14
+ attr_reader :exit_status, :environment, :working_directory, :main_class,
15
+ :io_wait_timeout, :exit_timeout, :startup_wait_time, :stop_signal
15
16
 
16
- def initialize(cmd, exit_timeout, io_wait_timeout, working_directory, environment = ENV.to_hash.dup, main_class = nil, stop_signal = nil, startup_wait_time = 0)
17
+ def initialize(cmd, exit_timeout, io_wait_timeout, working_directory,
18
+ environment = Aruba.platform.environment_variables.hash_from_env,
19
+ main_class = nil, stop_signal = nil, startup_wait_time = 0)
17
20
  @cmd = cmd
18
21
  @working_directory = working_directory
19
22
  @environment = environment
@@ -101,14 +104,6 @@ module Aruba
101
104
  @timed_out == true
102
105
  end
103
106
 
104
- # @deprecated
105
- # @private
106
- def run!
107
- Aruba.platform.deprecated('The use of "command#run!" is deprecated. You can simply use "command#start" instead.')
108
-
109
- start
110
- end
111
-
112
107
  # Hook which is run before command is run
113
108
  def before_run; end
114
109
 
@@ -117,18 +112,16 @@ module Aruba
117
112
 
118
113
  def inspect
119
114
  # rubocop:disable Style/UnneededInterpolation
120
- out = truncate("#{stdout(:wait_for_io => 0).inspect}", 35)
121
- err = truncate("#{stderr(:wait_for_io => 0).inspect}", 35)
115
+ out = truncate("#{stdout(wait_for_io: 0).inspect}", 35)
116
+ err = truncate("#{stderr(wait_for_io: 0).inspect}", 35)
122
117
  # rubocop:enable Style/UnneededInterpolation
123
118
 
124
119
  fmt = '#<%s:%s commandline="%s": stdout=%s stderr=%s>'
125
- format fmt, self.class, self.object_id, commandline, out, err
120
+ format fmt, self.class, object_id, commandline, out, err
126
121
  end
127
122
 
128
123
  alias to_s inspect
129
124
 
130
- private
131
-
132
125
  def command
133
126
  Shellwords.split(commandline).first
134
127
  end
@@ -139,8 +132,11 @@ module Aruba
139
132
  []
140
133
  end
141
134
 
135
+ private
136
+
142
137
  def truncate(string, max_length)
143
138
  return string if string.length <= max_length
139
+
144
140
  string[0, max_length - 1] + ' ...'
145
141
  end
146
142
  end
@@ -18,6 +18,7 @@ module Aruba
18
18
  end
19
19
 
20
20
  def start
21
+ @started = true
21
22
  Dir.chdir @working_directory do
22
23
  Aruba.platform.with_environment(environment) do
23
24
  @exit_status = system(command, *arguments) ? 0 : 1
@@ -64,6 +65,10 @@ module Aruba
64
65
  def terminate(*)
65
66
  stop
66
67
  end
68
+
69
+ def interactive?
70
+ true
71
+ end
67
72
  end
68
73
  end
69
74
  end
@@ -33,19 +33,22 @@ module Aruba
33
33
  end
34
34
 
35
35
  def exit(exitstatus)
36
- @exitstatus = exitstatus
36
+ @exitstatus =
37
+ case exitstatus
38
+ when Numeric then Integer(exitstatus)
39
+ when TrueClass then 0
40
+ when FalseClass then 1
41
+ else raise TypeError, "no implicit conversion of #{exitstatus.class} into Integer"
42
+ end
37
43
  end
38
44
  end
39
45
 
40
- class << self
41
- # @deprecated
42
- attr_accessor :main_class
43
- end
44
-
45
46
  # @private
46
47
  attr_reader :main_class
47
48
 
48
- def initialize(cmd, exit_timeout, io_wait_timeout, working_directory, environment = ENV.to_hash.dup, main_class = nil, stop_signal = nil, startup_wait_time = 0)
49
+ def initialize(cmd, exit_timeout, io_wait_timeout, working_directory,
50
+ environment = Aruba.platform.environment_variables.hash_from_env,
51
+ main_class = nil, stop_signal = nil, startup_wait_time = 0)
49
52
  @cmd = cmd
50
53
  @argv = arguments
51
54
  @stdin = StringIO.new
@@ -58,7 +61,9 @@ module Aruba
58
61
 
59
62
  # Start command
60
63
  def start
61
- fail "You need to call aruba.config.main_class = YourMainClass" unless main_class
64
+ fail 'You need to call aruba.config.main_class = YourMainClass' unless main_class
65
+
66
+ @started = true
62
67
 
63
68
  Dir.chdir @working_directory do
64
69
  before_run
@@ -120,6 +125,10 @@ module Aruba
120
125
  def pid
121
126
  $PROCESS_ID
122
127
  end
128
+
129
+ def interactive?
130
+ false
131
+ end
123
132
  end
124
133
  end
125
134
  end
@@ -19,24 +19,38 @@ module Aruba
19
19
  # @private
20
20
  class SpawnProcess < BasicProcess
21
21
  # Use as default launcher
22
- def self.match?(mode)
22
+ def self.match?(_mode)
23
23
  true
24
24
  end
25
25
 
26
26
  # Create process
27
27
  #
28
- # @params [String] cmd
28
+ # @param [String] cmd
29
29
  # Command string
30
30
  #
31
- # @params [Integer] exit_timeout
31
+ # @param [Numeric] exit_timeout
32
32
  # The timeout until we expect the command to be finished
33
33
  #
34
- # @params [Integer] io_wait_timeout
34
+ # @param [Numeric] io_wait_timeout
35
35
  # The timeout until we expect the io to be finished
36
36
  #
37
- # @params [String] working_directory
37
+ # @param [String] working_directory
38
38
  # The directory where the command will be executed
39
- def initialize(cmd, exit_timeout, io_wait_timeout, working_directory, environment = ENV.to_hash.dup, main_class = nil, stop_signal = nil, startup_wait_time = 0)
39
+ #
40
+ # @param [Hash] environment
41
+ # Environment variables
42
+ #
43
+ # @param [Class] main_class
44
+ # E.g. Cli::App::Runner
45
+ #
46
+ # @param [String] stop_signal
47
+ # Name of signal to send to stop process. E.g. 'HUP'.
48
+ #
49
+ # @param [Numeric] startup_wait_time
50
+ # The amount of seconds to wait after Aruba has started a command.
51
+ def initialize(cmd, exit_timeout, io_wait_timeout, working_directory,
52
+ environment = Aruba.platform.environment_variables.hash_from_env,
53
+ main_class = nil, stop_signal = nil, startup_wait_time = 0)
40
54
  super
41
55
 
42
56
  @process = nil
@@ -53,11 +67,12 @@ module Aruba
53
67
  def start
54
68
  # rubocop:disable Metrics/LineLength
55
69
  fail CommandAlreadyStartedError, %(Command "#{commandline}" has already been started. Please `#stop` the command first and `#start` it again. Alternatively use `#restart`.\n#{caller.join("\n")}) if started?
70
+
56
71
  # rubocop:enable Metrics/LineLength
57
72
 
58
73
  @started = true
59
74
 
60
- @process = ChildProcess.build(*[command_string.to_a, arguments].flatten)
75
+ @process = ChildProcess.build(*command_string.to_a)
61
76
  @stdout_file = Tempfile.new('aruba-stdout-')
62
77
  @stderr_file = Tempfile.new('aruba-stderr-')
63
78
 
@@ -139,14 +154,6 @@ module Aruba
139
154
  end
140
155
  end
141
156
 
142
- def read_stdout
143
- # rubocop:disable Metrics/LineLength
144
- Aruba.platform.deprecated('The use of "#read_stdout" is deprecated. Use "#stdout" instead. To reduce the time to wait for io, pass `:wait_for_io => 0` or some suitable for your use case')
145
- # rubocop:enable Metrics/LineLength
146
-
147
- stdout(:wait_for_io => 0)
148
- end
149
-
150
157
  def write(input)
151
158
  return if stopped?
152
159
 
@@ -233,7 +240,7 @@ module Aruba
233
240
  # @return [Aruba::Platforms::FilesystemStatus]
234
241
  # This returns a File::Stat-object
235
242
  def filesystem_status
236
- Aruba.platform.filesystem_status.new(command_string.to_s)
243
+ Aruba.platform.filesystem_status.new(command_path)
237
244
  end
238
245
 
239
246
  # Content of command
@@ -242,22 +249,27 @@ module Aruba
242
249
  # The content of the script/command. This might be binary output as
243
250
  # string if your command is a binary executable.
244
251
  def content
245
- File.read command_string.to_s
252
+ File.read command_path
253
+ end
254
+
255
+ def interactive?
256
+ true
246
257
  end
247
258
 
248
259
  private
249
260
 
250
261
  def command_string
251
- # gather fully qualified path
252
- cmd = Aruba.platform.which(command, environment['PATH'])
262
+ fail LaunchError, %(Command "#{command}" not found in PATH-variable "#{environment['PATH']}".) if command_path.nil?
253
263
 
254
- fail LaunchError, %(Command "#{command}" not found in PATH-variable "#{environment['PATH']}".) if cmd.nil?
264
+ Aruba.platform.command_string.new(command_path, *arguments)
265
+ end
255
266
 
256
- Aruba.platform.command_string.new(cmd)
267
+ def command_path
268
+ @command_path ||= Aruba.platform.which(command, environment['PATH'])
257
269
  end
258
270
 
259
- def wait_for_io(time_to_wait, &block)
260
- sleep time_to_wait.to_i
271
+ def wait_for_io(time_to_wait)
272
+ sleep time_to_wait
261
273
  yield
262
274
  end
263
275
 
@@ -5,16 +5,16 @@ require 'aruba/api'
5
5
  require 'aruba/version'
6
6
 
7
7
  RSpec.configure do |config|
8
- config.include Aruba::Api, :type => :aruba
8
+ config.include Aruba::Api, type: :aruba
9
9
 
10
10
  # Setup environment for aruba
11
11
  config.around :each do |example|
12
12
  if self.class.include? Aruba::Api
13
- restore_env
14
13
  setup_aruba
15
14
 
16
15
  # Modify PATH to include project/bin
17
- prepend_environment_variable 'PATH', aruba.config.command_search_paths.join(':') + ':'
16
+ prepend_environment_variable 'PATH',
17
+ aruba.config.command_search_paths.join(File::PATH_SEPARATOR) + File::PATH_SEPARATOR
18
18
 
19
19
  # Use configured home directory as HOME
20
20
  set_environment_variable 'HOME', aruba.config.home_directory
@@ -23,18 +23,17 @@ RSpec.configure do |config|
23
23
  example.run
24
24
 
25
25
  next unless self.class.include? Aruba::Api
26
+
26
27
  stop_all_commands
27
28
  end
28
29
 
29
- if Aruba::VERSION >= '1.0.0'
30
- config.around :each do |example|
31
- if self.class.include? Aruba::Api
32
- with_environment do
33
- example.run
34
- end
35
- else
30
+ config.around :each do |example|
31
+ if self.class.include? Aruba::Api
32
+ with_environment do
36
33
  example.run
37
34
  end
35
+ else
36
+ example.run
38
37
  end
39
38
  end
40
39
 
@@ -48,21 +47,9 @@ RSpec.configure do |config|
48
47
  config.before :each do |example|
49
48
  next unless self.class.include?(Aruba::Api)
50
49
 
51
- if example.metadata[:announce_environment]
52
- Aruba.platform.deprecated 'announce_environment is deprecated. Use announce_changed_environment instead'
53
-
54
- aruba.announcer.activate(:changed_environment)
55
- end
56
-
57
50
  aruba.announcer.activate(:full_environment) if example.metadata[:announce_full_environment]
58
51
  aruba.announcer.activate(:changed_environment) if example.metadata[:announce_changed_environment]
59
52
 
60
- if example.metadata[:announce_modified_environment]
61
- Aruba.platform.deprecated 'announce_modified_environment is deprecated. Use announce_changed_environment instead'
62
-
63
- aruba.announcer.activate(:changed_environment)
64
- end
65
-
66
53
  aruba.announcer.activate(:command) if example.metadata[:announce_command]
67
54
  aruba.announcer.activate(:directory) if example.metadata[:announce_directory]
68
55
  aruba.announcer.activate(:full_environment) if example.metadata[:announce_full_environment]
@@ -1,4 +1,4 @@
1
- require 'aruba/config'
1
+ require 'aruba/configuration'
2
2
  require 'aruba/aruba_path'
3
3
  require 'aruba/config_wrapper'
4
4
  require 'aruba/events'
@@ -49,7 +49,7 @@ module Aruba
49
49
 
50
50
  @environment.update(@config.command_runtime_environment)
51
51
 
52
- @command_monitor = opts.fetch(:command_monitor, Aruba.platform.command_monitor.new(:announcer => @announcer))
52
+ @command_monitor = opts.fetch(:command_monitor, Aruba.platform.command_monitor.new(announcer: @announcer))
53
53
 
54
54
  @logger = opts.fetch(:logger, Aruba.platform.logger.new)
55
55
  @logger.mode = @config.log_level
@@ -77,11 +77,13 @@ module Aruba
77
77
  # @return [ArubaPath]
78
78
  # The directory to where your fixtures are stored
79
79
  def fixtures_directory
80
- unless @fixtures_directory
80
+ @fixtures_directory ||= begin
81
81
  candidates = config.fixtures_directories.map { |dir| File.join(root_directory, dir) }
82
- @fixtures_directory = candidates.find { |d| Aruba.platform.directory? d }
82
+ directory = candidates.find { |d| Aruba.platform.directory? d }
83
83
 
84
- fail "No existing fixtures directory found in #{candidates.map { |d| format('"%s"', d) }.join(', ')}. " unless @fixtures_directory
84
+ fail "No existing fixtures directory found in #{candidates.map { |d| format('"%s"', d) }.join(', ')}." unless directory
85
+
86
+ directory
85
87
  end
86
88
 
87
89
  fail %(Fixtures directory "#{@fixtures_directory}" is not a directory) unless Aruba.platform.directory?(@fixtures_directory)