aruba 0.14.10 → 1.0.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.
Files changed (299) hide show
  1. checksums.yaml +4 -4
  2. data/.cucumberproignore +3 -0
  3. data/.github/ISSUE_TEMPLATE.md +48 -0
  4. data/.github/PULL_REQUEST_TEMPLATE.md +41 -0
  5. data/.gitignore +1 -0
  6. data/.rspec +1 -1
  7. data/.rubocop.yml +20 -181
  8. data/.rubocop_todo.yml +262 -0
  9. data/.simplecov +7 -5
  10. data/.travis.yml +53 -25
  11. data/.yardopts +3 -0
  12. data/CHANGELOG.md +585 -248
  13. data/CONTRIBUTING.md +247 -45
  14. data/Dockerfile +67 -0
  15. data/Gemfile +5 -106
  16. data/LICENSE +1 -1
  17. data/README.md +57 -180
  18. data/Rakefile +63 -32
  19. data/appveyor.yml +8 -11
  20. data/aruba.gemspec +47 -41
  21. data/bin/console +7 -0
  22. data/bin/test +9 -0
  23. data/cucumber.yml +4 -24
  24. data/doc/dependency_decisions.yml +42 -2
  25. data/docker-compose.yml +26 -0
  26. data/{bin → exe}/aruba +1 -1
  27. data/fixtures/cli-app/Rakefile +1 -1
  28. data/fixtures/cli-app/bin/aruba-test-cli +1 -1
  29. data/fixtures/cli-app/cli-app.gemspec +1 -2
  30. data/fixtures/cli-app/features/support/aruba.rb +1 -0
  31. data/fixtures/cli-app/features/support/env.rb +1 -1
  32. data/fixtures/cli-app/lib/cli/app/suppress_simple_cov_output.rb +3 -3
  33. data/fixtures/cli-app/lib/cli/app/version.rb +1 -1
  34. data/fixtures/cli-app/lib/cli/app.rb +1 -5
  35. data/fixtures/cli-app/spec/spec_helper.rb +4 -7
  36. data/fixtures/empty-app/Rakefile +1 -1
  37. data/fixtures/empty-app/cli-app.gemspec +1 -2
  38. data/fixtures/empty-app/lib/cli/app/version.rb +1 -1
  39. data/fixtures/getting-started-app/Gemfile +1 -1
  40. data/lib/aruba/api/commands.rb +85 -143
  41. data/lib/aruba/api/core.rb +48 -41
  42. data/lib/aruba/api/environment.rb +16 -7
  43. data/lib/aruba/api/filesystem.rb +43 -30
  44. data/lib/aruba/api/text.rb +3 -9
  45. data/lib/aruba/api.rb +6 -11
  46. data/lib/aruba/aruba_path.rb +27 -89
  47. data/lib/aruba/basic_configuration.rb +4 -24
  48. data/lib/aruba/cli.rb +1 -1
  49. data/lib/aruba/command.rb +2 -0
  50. data/lib/aruba/config/jruby.rb +1 -1
  51. data/lib/aruba/config_wrapper.rb +1 -1
  52. data/lib/aruba/configuration.rb +92 -0
  53. data/lib/aruba/console/help.rb +1 -7
  54. data/lib/aruba/console.rb +5 -5
  55. data/lib/aruba/contracts/absolute_path.rb +2 -2
  56. data/lib/aruba/contracts/relative_path.rb +2 -2
  57. data/lib/aruba/cucumber/command.rb +136 -95
  58. data/lib/aruba/cucumber/environment.rb +1 -1
  59. data/lib/aruba/cucumber/file.rb +21 -23
  60. data/lib/aruba/cucumber/hooks.rb +18 -13
  61. data/lib/aruba/cucumber/testing_frameworks.rb +74 -50
  62. data/lib/aruba/cucumber.rb +0 -6
  63. data/lib/aruba/event_bus/name_resolver.rb +5 -16
  64. data/lib/aruba/hooks.rb +1 -1
  65. data/lib/aruba/in_config_wrapper.rb +5 -1
  66. data/lib/aruba/initializer.rb +36 -42
  67. data/lib/aruba/matchers/base/base_matcher.rb +2 -2
  68. data/lib/aruba/matchers/base/message_indenter.rb +19 -0
  69. data/lib/aruba/matchers/base/object_formatter.rb +2 -9
  70. data/lib/aruba/matchers/collection/include_an_object.rb +7 -9
  71. data/lib/aruba/matchers/command/be_successfully_executed.rb +6 -4
  72. data/lib/aruba/matchers/command/have_exit_status.rb +14 -4
  73. data/lib/aruba/matchers/command/have_finished_in_time.rb +3 -5
  74. data/lib/aruba/matchers/command/have_output.rb +10 -5
  75. data/lib/aruba/matchers/command/have_output_on_stderr.rb +2 -2
  76. data/lib/aruba/matchers/command/have_output_on_stdout.rb +2 -2
  77. data/lib/aruba/matchers/command/have_output_size.rb +2 -2
  78. data/lib/aruba/matchers/directory/be_an_existing_directory.rb +5 -7
  79. data/lib/aruba/matchers/directory/have_sub_directory.rb +4 -6
  80. data/lib/aruba/matchers/file/be_a_command_found_in_path.rb +2 -4
  81. data/lib/aruba/matchers/file/be_an_existing_executable.rb +4 -6
  82. data/lib/aruba/matchers/file/be_an_existing_file.rb +5 -7
  83. data/lib/aruba/matchers/file/have_file_content.rb +4 -4
  84. data/lib/aruba/matchers/file/have_file_size.rb +6 -8
  85. data/lib/aruba/matchers/file/have_same_file_content.rb +5 -8
  86. data/lib/aruba/matchers/path/a_path_matching_pattern.rb +2 -4
  87. data/lib/aruba/matchers/path/be_an_absolute_path.rb +3 -5
  88. data/lib/aruba/matchers/path/be_an_existing_path.rb +4 -6
  89. data/lib/aruba/matchers/path/have_permissions.rb +6 -8
  90. data/lib/aruba/matchers/string/include_output_string.rb +8 -10
  91. data/lib/aruba/matchers/string/match_output_string.rb +9 -11
  92. data/lib/aruba/matchers/string/output_string_eq.rb +8 -10
  93. data/lib/aruba/platform.rb +0 -8
  94. data/lib/aruba/platforms/announcer.rb +42 -79
  95. data/lib/aruba/platforms/aruba_file_creator.rb +2 -6
  96. data/lib/aruba/platforms/aruba_fixed_size_file_creator.rb +2 -2
  97. data/lib/aruba/platforms/aruba_logger.rb +23 -7
  98. data/lib/aruba/platforms/command_monitor.rb +12 -104
  99. data/lib/aruba/platforms/determine_disk_usage.rb +56 -14
  100. data/lib/aruba/platforms/filesystem_status.rb +10 -14
  101. data/lib/aruba/platforms/local_environment.rb +2 -2
  102. data/lib/aruba/platforms/simple_table.rb +3 -11
  103. data/lib/aruba/platforms/unix_command_string.rb +7 -11
  104. data/lib/aruba/platforms/unix_environment_variables.rb +18 -27
  105. data/lib/aruba/platforms/unix_platform.rb +20 -51
  106. data/lib/aruba/platforms/unix_which.rb +2 -1
  107. data/lib/aruba/platforms/windows_command_string.rb +15 -10
  108. data/lib/aruba/platforms/windows_environment_variables.rb +43 -44
  109. data/lib/aruba/platforms/windows_platform.rb +4 -0
  110. data/lib/aruba/platforms/windows_which.rb +4 -3
  111. data/lib/aruba/processes/basic_process.rb +28 -30
  112. data/lib/aruba/processes/debug_process.rb +12 -3
  113. data/lib/aruba/processes/in_process.rb +17 -8
  114. data/lib/aruba/processes/spawn_process.rb +40 -41
  115. data/lib/aruba/rspec.rb +14 -36
  116. data/lib/aruba/runtime.rb +3 -6
  117. data/lib/aruba/setup.rb +6 -6
  118. data/lib/aruba/tasks/docker_helpers.rb +154 -0
  119. data/lib/aruba/version.rb +1 -1
  120. metadata +190 -236
  121. data/features/.nav +0 -72
  122. data/features/01_getting_started_with_aruba/cleanup_working_directory.feature +0 -57
  123. data/features/01_getting_started_with_aruba/run_commands.feature +0 -217
  124. data/features/01_getting_started_with_aruba/supported_testing_frameworks.feature +0 -88
  125. data/features/02_configure_aruba/activate_announcer_on_command_failure.feature +0 -38
  126. data/features/02_configure_aruba/basics.feature +0 -151
  127. data/features/02_configure_aruba/command_runtime_environment.feature +0 -129
  128. data/features/02_configure_aruba/console_history_file.feature +0 -38
  129. data/features/02_configure_aruba/exit_timeout.feature +0 -60
  130. data/features/02_configure_aruba/fixtures_directories.feature +0 -38
  131. data/features/02_configure_aruba/fixtures_path_prefix.feature +0 -23
  132. data/features/02_configure_aruba/home_directory.feature +0 -80
  133. data/features/02_configure_aruba/io_timeout.feature +0 -30
  134. data/features/02_configure_aruba/keep_ansi.feature +0 -30
  135. data/features/02_configure_aruba/log_level.feature +0 -38
  136. data/features/02_configure_aruba/physical_block_size.feature +0 -53
  137. data/features/02_configure_aruba/remove_ansi_escape_sequences.feature +0 -38
  138. data/features/02_configure_aruba/root_directory.feature +0 -30
  139. data/features/02_configure_aruba/startup_wait_time.feature +0 -48
  140. data/features/02_configure_aruba/working_directory.feature +0 -38
  141. data/features/03_testing_frameworks/cucumber/announce_information_for_troubleshooting.feature +0 -263
  142. data/features/03_testing_frameworks/cucumber/disable_bunder.feature +0 -18
  143. data/features/03_testing_frameworks/cucumber/steps/command/check_for_exit_statuses.feature +0 -136
  144. data/features/03_testing_frameworks/cucumber/steps/command/check_output_of_command.feature +0 -514
  145. data/features/03_testing_frameworks/cucumber/steps/command/check_stderr_of_command.feature +0 -68
  146. data/features/03_testing_frameworks/cucumber/steps/command/check_stdout_of_command.feature +0 -109
  147. data/features/03_testing_frameworks/cucumber/steps/command/debug_your_command_in_aruba.feature +0 -92
  148. data/features/03_testing_frameworks/cucumber/steps/command/run_a_command.feature +0 -66
  149. data/features/03_testing_frameworks/cucumber/steps/command/run_command_in_process.feature +0 -485
  150. data/features/03_testing_frameworks/cucumber/steps/command/run_command_interactively.feature +0 -90
  151. data/features/03_testing_frameworks/cucumber/steps/command/run_commands_which_require_a_shell.feature +0 -79
  152. data/features/03_testing_frameworks/cucumber/steps/command/send_signal_to_command.feature +0 -83
  153. data/features/03_testing_frameworks/cucumber/steps/command/stop_command.feature +0 -285
  154. data/features/03_testing_frameworks/cucumber/steps/environment/append_environment_variable.feature +0 -52
  155. data/features/03_testing_frameworks/cucumber/steps/environment/modify_home_variable_for_testing.feature +0 -62
  156. data/features/03_testing_frameworks/cucumber/steps/environment/prepend_environment_variable.feature +0 -52
  157. data/features/03_testing_frameworks/cucumber/steps/environment/set_environment_variable.feature +0 -49
  158. data/features/03_testing_frameworks/cucumber/steps/filesystem/append_to_file.feature +0 -45
  159. data/features/03_testing_frameworks/cucumber/steps/filesystem/cd_to_directory.feature +0 -33
  160. data/features/03_testing_frameworks/cucumber/steps/filesystem/check_existence_of_directory.feature +0 -57
  161. data/features/03_testing_frameworks/cucumber/steps/filesystem/check_existence_of_file.feature +0 -43
  162. data/features/03_testing_frameworks/cucumber/steps/filesystem/check_file_content.feature +0 -143
  163. data/features/03_testing_frameworks/cucumber/steps/filesystem/check_non_existence_of_directory.feature +0 -69
  164. data/features/03_testing_frameworks/cucumber/steps/filesystem/check_non_existence_of_file.feature +0 -80
  165. data/features/03_testing_frameworks/cucumber/steps/filesystem/check_permissions_of_file.feature +0 -39
  166. data/features/03_testing_frameworks/cucumber/steps/filesystem/compare_files.feature +0 -42
  167. data/features/03_testing_frameworks/cucumber/steps/filesystem/copy_file_or_directory.feature +0 -45
  168. data/features/03_testing_frameworks/cucumber/steps/filesystem/create_directory.feature +0 -57
  169. data/features/03_testing_frameworks/cucumber/steps/filesystem/create_file.feature +0 -76
  170. data/features/03_testing_frameworks/cucumber/steps/filesystem/move_file_or_directory.feature +0 -44
  171. data/features/03_testing_frameworks/cucumber/steps/filesystem/overwrite_file.feature +0 -72
  172. data/features/03_testing_frameworks/cucumber/steps/filesystem/remove_directory.feature +0 -38
  173. data/features/03_testing_frameworks/cucumber/steps/filesystem/remove_file.feature +0 -38
  174. data/features/03_testing_frameworks/cucumber/steps/filesystem/use_fixtures_for_setup_test.feature +0 -77
  175. data/features/03_testing_frameworks/rspec/hooks/define_after_hook_for_commands.feature +0 -43
  176. data/features/03_testing_frameworks/rspec/hooks/define_before_hook_for_commands.feature +0 -71
  177. data/features/03_testing_frameworks/rspec/setup_aruba_for_rspec.feature +0 -179
  178. data/features/04_aruba_api/command/find_a_started_command.feature +0 -83
  179. data/features/04_aruba_api/command/find_command_in_PATH.feature +0 -37
  180. data/features/04_aruba_api/command/read_stderr_of_command.feature +0 -46
  181. data/features/04_aruba_api/command/read_stdout_of_command.feature +0 -46
  182. data/features/04_aruba_api/command/run_command.feature +0 -423
  183. data/features/04_aruba_api/command/run_simple.feature +0 -254
  184. data/features/04_aruba_api/command/send_signal_to_command.feature +0 -53
  185. data/features/04_aruba_api/command/stop_all_commands.feature +0 -57
  186. data/features/04_aruba_api/command/stop_single_command.feature +0 -132
  187. data/features/04_aruba_api/command/terminate_all_commands.feature +0 -57
  188. data/features/04_aruba_api/command/use_last_command_started.feature +0 -50
  189. data/features/04_aruba_api/command/use_last_command_stopped.feature +0 -89
  190. data/features/04_aruba_api/core/expand_path.feature +0 -88
  191. data/features/04_aruba_api/environment/append_environment_variable.feature +0 -128
  192. data/features/04_aruba_api/environment/delete_environment_variable.feature +0 -63
  193. data/features/04_aruba_api/environment/prepend_environment_variable.feature +0 -128
  194. data/features/04_aruba_api/environment/set_environment_variable.feature +0 -376
  195. data/features/04_aruba_api/filesystem/cd_to_directory.feature +0 -184
  196. data/features/04_aruba_api/filesystem/check_existence_file_or_directory.feature +0 -62
  197. data/features/04_aruba_api/filesystem/check_if_path_is_absolute.feature +0 -48
  198. data/features/04_aruba_api/filesystem/check_if_path_is_directory.feature +0 -53
  199. data/features/04_aruba_api/filesystem/check_if_path_is_file.feature +0 -54
  200. data/features/04_aruba_api/filesystem/check_if_path_is_relative.feature +0 -48
  201. data/features/04_aruba_api/filesystem/create_directory.feature +0 -57
  202. data/features/04_aruba_api/filesystem/move_file_or_directory.feature +0 -119
  203. data/features/04_aruba_api/filesystem/report_disk_usage.feature +0 -152
  204. data/features/04_aruba_api/filesystem/use_fixtures.feature +0 -104
  205. data/features/04_aruba_api/text/extract_text.feature +0 -87
  206. data/features/04_aruba_api/text/replace_variables.feature +0 -45
  207. data/features/04_aruba_api/text/sanitize_text.feature +0 -228
  208. data/features/04_aruba_api/text/unescape_text.feature +0 -127
  209. data/features/05_use_rspec_matchers/command/check_timeouts.feature +0 -48
  210. data/features/05_use_rspec_matchers/directory/have_sub_directory.feature +0 -110
  211. data/features/05_use_rspec_matchers/file/be_a_command_found_in_path.feature +0 -115
  212. data/features/05_use_rspec_matchers/file/be_existing_executable.feature +0 -88
  213. data/features/05_use_rspec_matchers/file/be_existing_file.feature +0 -82
  214. data/features/05_use_rspec_matchers/file/have_file_content.feature +0 -123
  215. data/features/05_use_rspec_matchers/file/have_file_size.feature +0 -107
  216. data/features/05_use_rspec_matchers/path/be_an_absolute_path.feature +0 -74
  217. data/features/05_use_rspec_matchers/path/be_an_existing_path.feature +0 -97
  218. data/features/05_use_rspec_matchers/path/have_permissions.feature +0 -118
  219. data/features/06_use_aruba_cli/initialize_project_with_aruba.feature +0 -79
  220. data/features/06_use_aruba_cli/open_console.feature +0 -52
  221. data/features/08_other/improve_performance_if_using_jruby.feature +0 -37
  222. data/features/step_definitions/hooks.rb +0 -146
  223. data/features/support/aruba.rb +0 -7
  224. data/features/support/env.rb +0 -33
  225. data/features/support/jruby.rb +0 -5
  226. data/features/support/simplecov_setup.rb +0 -11
  227. data/fixtures/spawn_process/stderr.sh +0 -3
  228. data/lib/aruba/api/deprecated.rb +0 -1163
  229. data/lib/aruba/config.rb +0 -107
  230. data/lib/aruba/cucumber/core.rb +0 -5
  231. data/lib/aruba/cucumber/deprecated.rb +0 -93
  232. data/lib/aruba/cucumber/rvm.rb +0 -3
  233. data/lib/aruba/in_process.rb +0 -16
  234. data/lib/aruba/jruby.rb +0 -4
  235. data/lib/aruba/matchers/deprecated/file.rb +0 -17
  236. data/lib/aruba/matchers/deprecated.rb +0 -1
  237. data/lib/aruba/matchers/path/match_path_pattern.rb +0 -41
  238. data/lib/aruba/matchers/rspec_matcher_include_regexp.rb +0 -25
  239. data/lib/aruba/platforms/disk_usage_calculator.rb +0 -20
  240. data/lib/aruba/reporting.rb +0 -126
  241. data/lib/aruba/spawn_process.rb +0 -14
  242. data/script/bootstrap +0 -24
  243. data/script/console +0 -16
  244. data/script/test +0 -3
  245. data/spec/aruba/api/bundler_spec.rb +0 -15
  246. data/spec/aruba/api/core_spec.rb +0 -142
  247. data/spec/aruba/api/deprecated_spec.rb +0 -421
  248. data/spec/aruba/api/filesystem_spec.rb +0 -746
  249. data/spec/aruba/api/runtime_spec.rb +0 -28
  250. data/spec/aruba/api_spec.rb +0 -97
  251. data/spec/aruba/aruba_path_spec.rb +0 -103
  252. data/spec/aruba/basic_configuration_spec.rb +0 -5
  253. data/spec/aruba/configuration_spec.rb +0 -5
  254. data/spec/aruba/hooks_spec.rb +0 -17
  255. data/spec/aruba/in_config_wrapper_spec.rb +0 -25
  256. data/spec/aruba/jruby_spec.rb +0 -73
  257. data/spec/aruba/matchers/command/have_output_size_spec.rb +0 -25
  258. data/spec/aruba/matchers/command_spec.rb +0 -174
  259. data/spec/aruba/matchers/deprecated_spec.rb +0 -120
  260. data/spec/aruba/matchers/directory_spec.rb +0 -57
  261. data/spec/aruba/matchers/file_spec.rb +0 -208
  262. data/spec/aruba/matchers/path_spec.rb +0 -58
  263. data/spec/aruba/platform/simple_table_spec.rb +0 -23
  264. data/spec/aruba/platform/windows_environment_variables_spec.rb +0 -500
  265. data/spec/aruba/platforms/unix_command_string_spec.rb +0 -17
  266. data/spec/aruba/platforms/windows_command_string_spec.rb +0 -22
  267. data/spec/aruba/processes/spawn_process_spec.rb +0 -112
  268. data/spec/aruba/rspec_spec.rb +0 -15
  269. data/spec/aruba/runtime_spec.rb +0 -29
  270. data/spec/event_bus/name_resolver_spec.rb +0 -68
  271. data/spec/event_bus_spec.rb +0 -158
  272. data/spec/spec_helper.rb +0 -22
  273. data/spec/support/configs/.keep +0 -0
  274. data/spec/support/configs/aruba.rb +0 -5
  275. data/spec/support/configs/pry.rb +0 -3
  276. data/spec/support/configs/rspec.rb +0 -15
  277. data/spec/support/helpers/.keep +0 -0
  278. data/spec/support/helpers/reporting.rb +0 -44
  279. data/spec/support/matchers/.keep +0 -0
  280. data/spec/support/matchers/option.rb +0 -35
  281. data/spec/support/shared_contexts/.keep +0 -0
  282. data/spec/support/shared_contexts/aruba.rb +0 -49
  283. data/spec/support/shared_examples/.keep +0 -0
  284. data/spec/support/shared_examples/configuration.rb +0 -116
  285. data/spec/support/shared_examples/directory.rb +0 -7
  286. data/spec/support/shared_examples/file.rb +0 -7
  287. data/templates/css/console.css +0 -24
  288. data/templates/css/filesystem.css +0 -42
  289. data/templates/css/pygments-autumn.css +0 -59
  290. data/templates/files.erb +0 -14
  291. data/templates/images/LICENSE +0 -22
  292. data/templates/images/folder.png +0 -0
  293. data/templates/images/page_white.png +0 -0
  294. data/templates/images/page_white_gherkin.png +0 -0
  295. data/templates/images/page_white_ruby.png +0 -0
  296. data/templates/index.erb +0 -20
  297. data/templates/js/filesystem.js +0 -5
  298. data/templates/js/jquery-1.11.3.min.js +0 -5
  299. data/templates/main.erb +0 -34
@@ -1,1163 +0,0 @@
1
- require 'aruba/platforms/announcer'
2
-
3
- # Aruba
4
- module Aruba
5
- # Api
6
- module Api
7
- # Deprecated
8
- module Deprecated
9
- # @deprecated
10
- # The path to the directory which should contain all your test data
11
- # You might want to overwrite this method to place your data else where.
12
- #
13
- # @return [Array]
14
- # The directory path: Each subdirectory is a member of an array
15
- def dirs
16
- Aruba.platform.deprecated(
17
- 'The use of "dirs" is deprecated.' \
18
- ' Use "Aruba.configure { |c| c.current_directory = \'path/to/dir\' }"' \
19
- ' instead to set the current directory and "expand_path(".")" to get' \
20
- ' the current directory or use "#cd(\'.\') { # your code }" to run' \
21
- ' code in the current directory'
22
- )
23
-
24
- @dirs ||= aruba.current_directory
25
- end
26
-
27
- # @deprecated
28
- # Get access to current dir
29
- #
30
- # @return
31
- # Current directory
32
- def current_directory
33
- Aruba.platform.deprecated(
34
- 'The use of "current_directory" is deprecated.' \
35
- ' Use "expand_path(".")" to get the current directory or "#cd" to run' \
36
- ' code in the current directory.'
37
- )
38
-
39
- aruba.current_directory.to_s
40
- end
41
-
42
- # @deprecated
43
- # Clean the current directory
44
- def clean_current_directory
45
- Aruba.platform.deprecated(
46
- 'The use of "clean_current_directory" is deprecated.' \
47
- ' Either use "#setup_aruba" or "#remove(\'.\')" to clean up Aruba\'s' \
48
- ' working directory before your tests are run'
49
- )
50
-
51
- setup_aruba
52
- end
53
-
54
- # @deprecated
55
- def detect_ruby(cmd)
56
- Aruba.platform.deprecated('The use of "#detect_ruby" is deprecated')
57
-
58
- Aruba.platform.detect_ruby cmd
59
- end
60
-
61
- # @deprecated
62
- def current_ruby
63
- Aruba.platform.deprecated('The use of "#current_ruby" is deprecated')
64
-
65
- Aruba.platform.current_ruby cmd
66
- end
67
-
68
- # @deprecated
69
- def _ensure_newline(str)
70
- Aruba.platform.deprecated('The use of "#_ensure_newline" is deprecated')
71
-
72
- Aruba.platform.ensure_newline cmd
73
- end
74
-
75
- # @deprecated
76
- def absolute_path(*args)
77
- Aruba.platform.deprecated(
78
- 'The use of "absolute_path" is deprecated.' \
79
- ' Use "expand_path" instead.' \
80
- ' But be aware that "expand_path" uses a different implementation'
81
- )
82
-
83
- File.expand_path File.join(*args), aruba.current_directory
84
- end
85
-
86
- # @deprecated
87
- def _read_interactive
88
- Aruba.platform.deprecated(
89
- 'The use of "#_read_interactive" is deprecated.' \
90
- ' Use "last_command_started.stdout" instead'
91
- )
92
-
93
- last_command_started.stdout
94
- end
95
-
96
- # @deprecated
97
- def announce_or_puts(msg)
98
- Aruba.platform.deprecated(
99
- 'The use of "#announce_or_puts" is deprecated.' \
100
- ' Use "#announcer.mode = :kernel" or "#announcer.mode = :puts" instead'
101
- )
102
-
103
- if(@puts)
104
- Kernel.puts(msg)
105
- else
106
- puts(msg)
107
- end
108
- end
109
-
110
- # @deprecated
111
- def _write_interactive(input)
112
- Aruba.platform.deprecated(
113
- 'The use of "#_write_interactive" is deprecated.' \
114
- ' Use "#last_command_started.write()" instead'
115
- )
116
-
117
- last_command_started.write(input)
118
- end
119
-
120
- # @deprecated
121
- def eot
122
- Aruba.platform.deprecated(
123
- 'The use of "#eot" is deprecated.' \
124
- ' Use "#close_input" instead.'
125
- )
126
-
127
- close_input
128
- end
129
-
130
- # Run a command interactively
131
- #
132
- # @param [String] cmd
133
- # The command to by run
134
- #
135
- # @see #cmd
136
- # @deprecated
137
- def run_interactive(cmd)
138
- Aruba.platform.deprecated(
139
- 'The use of "#run_interactive" is deprecated.' \
140
- ' Use "run_command" instead'
141
- )
142
-
143
- run_command(cmd)
144
- end
145
-
146
- # Run given command and stop it if timeout is reached
147
- #
148
- # @param [String] cmd
149
- # The command which should be executed
150
- #
151
- # @param [Hash] opts
152
- # Options
153
- #
154
- # @option [Integer] exit_timeout
155
- # If the timeout is reached the command will be killed
156
- #
157
- # @option [Integer] io_wait_timeout
158
- # Wait for IO to finish
159
- #
160
- # @option [Integer] startup_wait_time
161
- # Wait for a command to start
162
- #
163
- # @option [String] stop_signal
164
- # Use signal to stop command
165
- #
166
- # @yield [SpawnProcess]
167
- # Run block with process
168
- #
169
- # @see #run_command
170
- # @deprecated
171
- def run(*args)
172
- Aruba.platform.deprecated(
173
- 'The use of "#run" is deprecated.' \
174
- ' Use "run_command" instead'
175
- )
176
-
177
- run_command(*args)
178
- end
179
-
180
- # Run a command with aruba
181
- #
182
- # Checks for error during command execution and checks the output to detect
183
- # an timeout error.
184
- #
185
- # @param [String] cmd
186
- # The command to be executed
187
- #
188
- # @param [Hash] options
189
- # Options for aruba
190
- #
191
- # @option [TrueClass,FalseClass] fail_on_error
192
- # Should aruba fail on error?
193
- #
194
- # @option [Integer] exit_timeout
195
- # Timeout for execution
196
- #
197
- # @option [Integer] io_wait_timeout
198
- # Timeout for IO - STDERR, STDOUT
199
- #
200
- def run_simple(*args)
201
- Aruba.platform.deprecated(
202
- 'The use of "#run_simple" is deprecated.' \
203
- ' Use "run_command_and_stop" instead'
204
- )
205
-
206
- run_command_and_stop(*args)
207
- end
208
-
209
- # @deprecated
210
- # Create an empty file
211
- #
212
- # @param [String] file_name
213
- # The name of the file
214
- def touch_file(*args)
215
- Aruba.platform.deprecated(
216
- 'The use of "#touch_file" is deprecated.' \
217
- ' Use "#touch" instead'
218
- )
219
-
220
- touch(*args)
221
- end
222
-
223
- # @deprecated
224
- def mod?(file, perms, &block)
225
- Aruba.platform.deprecated(
226
- 'The use of "#mod?" is deprecated.' \
227
- ' Use "expect(file).to have_permissions(perms)" instead'
228
- )
229
-
230
- expect(Array(file)).to Aruba::Matchers.all have_permissions(perms)
231
- end
232
-
233
- # @deprecated
234
- # Remove file
235
- #
236
- # @param [String] file_name
237
- # The file which should be deleted in current directory
238
- def remove_file(*args)
239
- Aruba.platform.deprecated(
240
- 'The use of "#remove_file" is deprecated.' \
241
- ' Use "#remove" instead'
242
- )
243
-
244
- remove(*args)
245
- end
246
-
247
- # @deprecated
248
- def create_dir(*args)
249
- Aruba.platform.deprecated(
250
- 'The use of "#create_dir" is deprecated.' \
251
- ' Use "#create_directory" instead'
252
- )
253
- create_directory(*args)
254
- end
255
-
256
- # @deprecated
257
- # Remove directory
258
- #
259
- # @param [String] directory_name
260
- # The name of the directory which should be removed
261
- def remove_directory(*args)
262
- Aruba.platform.deprecated(
263
- 'The use of "remove_directory" is deprecated.' \
264
- ' Use "remove" instead'
265
- )
266
- remove(*args)
267
- end
268
-
269
- # @deprecated
270
- def remove_dir(*args)
271
- Aruba.platform.deprecated(
272
- 'The use of "remove_dir" is deprecated.' \
273
- ' Use "remove" instead'
274
- )
275
- remove(*args)
276
- end
277
-
278
- # @deprecated
279
- #
280
- # Check if paths are present
281
- #
282
- # @param [#each] paths
283
- # The paths which should be checked
284
- #
285
- # @param [true,false] expect_presence
286
- # Should the given paths be present (true) or absent (false)
287
- def check_file_presence(paths, expect_presence = true)
288
- Aruba.platform.deprecated(
289
- 'The use of "check_file_presence" is deprecated.' \
290
- ' Use "expect(path).to be_an_existing_file" or' \
291
- ' "expect(all_paths).to all match /pattern/" instead'
292
- )
293
-
294
- stop_all_commands
295
-
296
- Array(paths).each do |path|
297
- if path.kind_of? Regexp
298
- if expect_presence
299
- expect(all_paths).to match_path_pattern(path)
300
- else
301
- expect(all_paths).not_to match_path_pattern(path)
302
- end
303
- else
304
- if expect_presence
305
- expect(path).to be_an_existing_file
306
- else
307
- expect(path).not_to be_an_existing_file
308
- end
309
- end
310
- end
311
- end
312
-
313
- # @deprecated
314
- # Check the file size of paths
315
- #
316
- # @params [Hash] paths_and_sizes
317
- # A hash containing the path (key) and the expected size (value)
318
- #
319
- # @example
320
- #
321
- # paths_and_sizes = {
322
- # 'file' => 10
323
- # }
324
- #
325
- # check_file_size(paths_and_sizes)
326
- #
327
- def check_file_size(paths_and_sizes)
328
- Aruba.platform.deprecated(
329
- 'The use of "#check_file_size" is deprecated.' \
330
- ' Use "expect(file).to have_file_size(size)" instead'
331
- )
332
-
333
- stop_all_commands
334
-
335
- paths_and_sizes.each do |path, size|
336
- expect(path).to have_file_size size
337
- end
338
- end
339
-
340
- # @deprecated
341
- def check_exact_file_content(file, exact_content, expect_match = true)
342
- Aruba.platform.deprecated(
343
- 'The use of "#check_exact_file_content" is deprecated.' \
344
- ' Use "expect(file).to have_file_content(content)" with a string'
345
- )
346
-
347
- check_file_content(file, exact_content, expect_match)
348
- end
349
-
350
- # @deprecated
351
- # Check if the content of file against the content of a reference file
352
- #
353
- # @param [String] file
354
- # The file to be checked
355
- #
356
- # @param [String] reference_file
357
- # The reference file
358
- #
359
- # @param [true, false] expect_match
360
- # Must the content be in the file or not
361
- def check_binary_file_content(file, reference_file, expect_match = true)
362
- Aruba.platform.deprecated(
363
- 'The use of "#check_binary_file_content" is deprecated.' \
364
- ' Use "expect(file).to have_same_file_content_as(file)"'
365
- )
366
-
367
- stop_all_commands
368
-
369
- if expect_match
370
- expect(file).to have_same_file_content_as reference_file
371
- else
372
- expect(file).not_to have_same_file_content_as reference_file
373
- end
374
- end
375
-
376
- # @deprecated
377
- # Check presence of a directory
378
- #
379
- # @param [Array] paths
380
- # The paths to be checked
381
- #
382
- # @param [true, false] expect_presence
383
- # Should the directory be there or should the directory not be there
384
- def check_directory_presence(paths, expect_presence)
385
- Aruba.platform.deprecated(
386
- 'The use of "#check_directory_presence" is deprecated.' \
387
- ' Use "expect(directory).to be_an_existing_directory"'
388
- )
389
-
390
- stop_all_commands
391
-
392
- paths.each do |path|
393
- path = expand_path(path)
394
-
395
- if expect_presence
396
- expect(path).to be_an_existing_directory
397
- else
398
- expect(path).not_to be_an_existing_directory
399
- end
400
- end
401
- end
402
-
403
- # @deprecated
404
- def prep_for_fs_check(&block)
405
- Aruba.platform.deprecated(
406
- 'The use of "prep_for_fs_check" is deprecated.' \
407
- ' Use apropriate methods and the new rspec matchers instead'
408
- )
409
-
410
- stop_all_commands
411
-
412
- cd('') { yield }
413
- end
414
-
415
- # @deprecated
416
- def assert_exit_status_and_partial_output(expect_to_pass, expected)
417
- Aruba.platform.deprecated(
418
- 'The use of "assert_exit_status_and_partial_output" is deprecated.' \
419
- ' Use "expect(last_command_started).to be_successfully_executed"' \
420
- ' and "expect(command).to have_output /partial/" instead.'
421
- )
422
-
423
- assert_success(expect_to_pass)
424
- assert_partial_output(expected, all_output)
425
- end
426
-
427
- # @deprecated
428
- def assert_exit_status_and_output(expect_to_pass, expected_output,
429
- expect_exact_output)
430
- assert_success(expect_to_pass)
431
- if expect_exact_output
432
- assert_exact_output(expected_output, all_output)
433
- else
434
- assert_partial_output(expected_output, all_output)
435
- end
436
- end
437
-
438
- # Check the content of file
439
- #
440
- # It supports partial content as well. And it is up to you to decided if
441
- # the content must be there or not.
442
- #
443
- # @param [String] file
444
- # The file to be checked
445
- #
446
- # @param [String, Regexp] content
447
- # The content which must/must not be in the file. If content is
448
- # a String exact match is done, if content is a Regexp then file
449
- # is matched using regular expression
450
- #
451
- # @param [true, false] expect_match
452
- # Must the content be in the file or not
453
- def check_file_content(file, content, expect_match = true)
454
- Aruba.platform.deprecated(
455
- 'The use of "#check_file_content" is deprecated.' \
456
- ' Use "expect(file).to have_file_content(content)" instead.' \
457
- ' For eq match use string, for partial match use /regex/'
458
- )
459
-
460
- stop_all_commands
461
-
462
- if expect_match
463
- expect(file).to have_file_content content
464
- else
465
- expect(file).not_to have_file_content content
466
- end
467
- end
468
-
469
- # @deprecated
470
- def _mkdir(dir_name)
471
- Aruba.platform.deprecated(
472
- 'The use of "#_mkdir" is deprecated'
473
- )
474
-
475
- Aruba.platform.mkdir(dir_name)
476
- end
477
-
478
- # @deprecated
479
- def _rm(dir_name)
480
- Aruba.platform.deprecated(
481
- 'The use of "#_rm_rf" is deprecated'
482
- )
483
-
484
- Aruba.platform.rm(dir_name)
485
- end
486
-
487
- # @deprecated
488
- def current_dir(*args, &block)
489
- Aruba.platform.deprecated(
490
- 'The use of "#current_dir" is deprecated.' \
491
- ' Use "#current_directory" instead'
492
- )
493
-
494
- current_directory(*args, &block)
495
- end
496
-
497
- # @deprecated
498
- def clean_current_dir(*args, &block)
499
- Aruba.platform.deprecated(
500
- 'The use of "clean_current_dir" is deprecated.' \
501
- ' Use "#setup_aruba" or `#remove(\'.\') to clean up Aruba\'s working' \
502
- ' directory before your tests are run'
503
- )
504
-
505
- setup_aruba
506
- end
507
-
508
- # @deprecated
509
- def in_current_dir(&block)
510
- Aruba.platform.deprecated(
511
- 'The use of "in_current_dir" is deprecated.' \
512
- ' Use "#in_current_directory { }" instead'
513
- )
514
-
515
- in_current_directory(&block)
516
- end
517
-
518
- # @deprecated
519
- # Run block with environment
520
- #
521
- # @param [Hash] env
522
- # The variables to be used for block.
523
- #
524
- # @yield
525
- # The block of code which should be run with the changed environment variables
526
- def with_env(env = {}, &block)
527
- Aruba.platform.deprecated(
528
- 'The use of "#with_env" is deprecated.' \
529
- ' Use "#with_environment {}" instead. But be careful this uses a' \
530
- ' different implementation'
531
- )
532
-
533
- env.each do |k,v|
534
- set_env k, v
535
- end
536
- yield
537
- restore_env
538
- end
539
-
540
- # @deprecated
541
- # Restore original process environment
542
- def restore_env
543
- Aruba.platform.deprecated(
544
- 'The use of "#restore_env" is deprecated.' \
545
- ' If you use "set_environment_variable" there\'s no need to restore' \
546
- ' the environment'
547
- )
548
-
549
- original_env.each do |key, value|
550
- if value
551
- ENV[key] = value
552
- aruba.environment[key] = value
553
- else
554
- aruba.environment.delete key
555
- ENV.delete key
556
- end
557
- end
558
- end
559
-
560
- # @deprecated
561
- # Set environment variable
562
- #
563
- # @param [String] key
564
- # The name of the environment variable as string, e.g. 'HOME'
565
- #
566
- # @param [String] value
567
- # The value of the environment variable. Needs to be a string.
568
- def set_env(key, value)
569
- Aruba.platform.deprecated(
570
- 'The use of "#set_env" is deprecated.' \
571
- ' Use "set_environment_variable" instead. ' \
572
- ' But be careful, this method uses a different kind of implementation'
573
- )
574
-
575
- aruba.announcer.announce(:environment, key, value)
576
- set_environment_variable key, value
577
-
578
- original_env[key] = ENV.delete(key) unless original_env.key? key
579
- ENV[key] = value
580
- end
581
-
582
- # @deprecated
583
- def original_env
584
- Aruba.platform.deprecated(
585
- 'The use of "#original_env" is deprecated'
586
- )
587
-
588
- @original_env ||= {}
589
- end
590
-
591
- # @deprecated
592
- def filesystem_permissions(*args)
593
- Aruba.platform.deprecated(
594
- 'The use of "#filesystem_permissions" is deprecated.' \
595
- ' Use "#chmod" instead'
596
- )
597
-
598
- chmod(*args)
599
- end
600
-
601
- # Check file system permissions of file
602
- #
603
- # @param [Octal] expected_permissions
604
- # Expected file system permissions, e.g. 0755
605
- # @param [String] file_names
606
- # The file name(s)
607
- # @param [Boolean] expected_result
608
- # Are the permissions expected to be mode or are they expected not to be mode?
609
- def check_filesystem_permissions(*args)
610
- Aruba.platform.deprecated(
611
- 'The use of "#check_filesystem_permissions" is deprecated.' \
612
- ' Use "expect(path).to have_permissions perms" instead'
613
- )
614
-
615
- args = args.flatten
616
-
617
- expected_permissions = args.shift
618
- expected_result = args.pop
619
-
620
- args.each do |p|
621
- raise "Expected #{p} to be present" unless exist? p
622
-
623
- if expected_result
624
- expect(p).to have_permissions expected_permissions
625
- else
626
- expect(p).not_to have_permissions expected_permissions
627
- end
628
- end
629
- end
630
-
631
- # @deprecated
632
- def _create_file(name, content, check_presence)
633
- Aruba.platform.deprecated(
634
- 'The use of "#_create_file" is deprecated.'
635
- )
636
-
637
- ArubaFileCreator.new.write(expand_path(name), content, check_presence)
638
-
639
- self
640
- end
641
-
642
- # @deprecated
643
- def _create_fixed_size_file(file_name, file_size, check_presence)
644
- Aruba.platform.deprecated(
645
- 'The use of "#_create_fixed_size_file" is deprecated.'
646
- )
647
-
648
- ArubaFixedSizeFileCreator.new.write(expand_path(name), size, check_presence)
649
-
650
- self
651
- end
652
-
653
- # @deprecated
654
- # Unescape string
655
- #
656
- # @param [String] string
657
- # The string which should be unescaped, e.g. the output of a command
658
- #
659
- # @return
660
- # The string stripped from escape sequences
661
- def unescape(string, keep_ansi = false)
662
- Aruba.platform.deprecated(
663
- 'The use of "#unescape" is deprecated.' \
664
- ' Use "#sanitize_text" intead'
665
- )
666
-
667
- string = unescape_text(string)
668
- if !keep_ansi ||
669
- !aruba.config.keep_ansi ||
670
- aruba.config.remove_ansi_escape_sequences
671
- string = extract_text(string)
672
- end
673
-
674
- string
675
- end
676
-
677
- # @deprecated
678
- # The root directory of aruba
679
- def root_directory
680
- Aruba.platform.deprecated(
681
- 'The use of "#root_directory" is deprecated.' \
682
- ' Use "aruba.root_directory" instead'
683
- )
684
-
685
- aruba.root_directory
686
- end
687
-
688
- # The path to the directory which contains fixtures
689
- # You might want to overwrite this method to place your data else where.
690
- #
691
- # @return [String]
692
- # The directory to where your fixtures are stored
693
- def fixtures_directory
694
- Aruba.platform.deprecated(
695
- 'The use of "#fixtures_directory" is deprecated.' \
696
- ' Use "aruba.fixtures_directory" instead'
697
- )
698
-
699
- aruba.fixtures_directory
700
- end
701
-
702
- # @deprecated
703
- def check_for_deprecated_variables
704
- if defined? @aruba_exit_timeout
705
- Aruba.platform.deprecated(
706
- 'The use of "@aruba_exit_timeout" is deprecated.' \
707
- ' Use "#aruba.config.exit_timeout = <numeric>" instead'
708
- )
709
- aruba.config.exit_timeout = @aruba_exit_timeout
710
- end
711
-
712
- if defined? @aruba_io_wait_seconds
713
- Aruba.platform.deprecated(
714
- 'The use of "@aruba_io_wait_seconds" is deprecated.' \
715
- ' Use "#aruba.config.io_wait_timeout = <numeric>" instead'
716
- )
717
- aruba.config.io_wait_timeout = @aruba_io_wait_seconds
718
- end
719
-
720
- if defined? @keep_ansi
721
- Aruba.platform.deprecated(
722
- 'The use of "@aruba_keep_ansi" is deprecated.' \
723
- ' Use "#aruba.config.remove_ansi_escape_sequences = <true|false>" instead.' \
724
- ' Be aware that it uses an inverted logic'
725
- )
726
-
727
- aruba.config.remove_ansi_escape_sequences = false
728
- end
729
-
730
- if defined? @aruba_root_directory
731
- Aruba.platform.deprecated(
732
- 'The use of "@aruba_root_directory" is deprecated.' \
733
- ' Use "#aruba.config.root_directory = <string>" instead'
734
- )
735
-
736
- aruba.config.root_directory = @aruba_root_directory.to_s
737
- end
738
- end
739
-
740
- # Last command started
741
- def last_command
742
- Aruba.platform.deprecated(
743
- 'The use of "#last_command" is deprecated.' \
744
- ' Use "#last_command_started"'
745
- )
746
-
747
- process_monitor.last_command_started
748
- end
749
-
750
- # @deprecated
751
- #
752
- # Full compare arg1 and arg2
753
- #
754
- # @return [TrueClass, FalseClass]
755
- # If arg1 is exactly the same as arg2 return true, otherwise false
756
- def assert_exact_output(expected, actual)
757
- Aruba.platform.deprecated(
758
- 'The use of "#assert_exact_output" is deprecated.' \
759
- ' Use "expect(command).to have_output \'exact\'" instead.' \
760
- ' There are also special matchers for "stdout" and "stderr"'
761
- )
762
-
763
- actual.force_encoding(expected.encoding) if RUBY_VERSION >= "1.9"
764
- expect(Aruba.platform.unescape(actual, aruba.config.keep_ansi)).
765
- to eq Aruba.platform.unescape(expected, aruba.config.keep_ansi)
766
- end
767
-
768
- # @deprecated
769
- #
770
- # Partial compare arg1 and arg2
771
- #
772
- # @return [TrueClass, FalseClass]
773
- # If arg2 contains arg1 return true, otherwise false
774
- def assert_partial_output(expected, actual)
775
- Aruba.platform.deprecated(
776
- 'The use of "#assert_partial_output" is deprecated.' \
777
- ' Use "expect(command).to have_output /partial/" instead.' \
778
- ' There are also special matchers for "stdout" and "stderr"'
779
- )
780
-
781
- actual.force_encoding(expected.encoding) if RUBY_VERSION >= "1.9"
782
- expect(Aruba.platform.unescape(actual, aruba.config.keep_ansi)).
783
- to include(Aruba.platform.unescape(expected, aruba.config.keep_ansi))
784
- end
785
-
786
- # @deprecated
787
- #
788
- # Regex Compare arg1 and arg2
789
- #
790
- # @return [TrueClass, FalseClass]
791
- # If arg2 matches arg1 return true, otherwise false
792
- def assert_matching_output(expected, actual)
793
- Aruba.platform.deprecated(
794
- 'The use of "#assert_matching_output" is deprecated.' \
795
- ' Use "expect(command).to have_output /partial/" instead.' \
796
- ' There are also special matchers for "stdout" and "stderr"'
797
- )
798
-
799
- actual.force_encoding(expected.encoding) if RUBY_VERSION >= "1.9"
800
- expect(Aruba.platform.unescape(actual, aruba.config.keep_ansi)).
801
- to match(/#{Aruba.platform.unescape(expected, aruba.config.keep_ansi)}/m)
802
- end
803
-
804
- # @deprecated
805
- #
806
- # Negative regex compare arg1 and arg2
807
- #
808
- # @return [TrueClass, FalseClass]
809
- # If arg2 does not match arg1 return true, otherwise false
810
- def assert_not_matching_output(expected, actual)
811
- Aruba.platform.deprecated(
812
- 'The use of "#assert_not_matching_output" is deprecated.' \
813
- ' Use "expect(command).not_to have_output /partial/" instead.' \
814
- ' There are also special matchers for "stdout" and "stderr"'
815
- )
816
-
817
- actual.force_encoding(expected.encoding) if RUBY_VERSION >= "1.9"
818
- expect(Aruba.platform.unescape(actual, aruba.config.keep_ansi)).
819
- not_to match(/#{Aruba.platform.unescape(expected, aruba.config.keep_ansi)}/m)
820
- end
821
-
822
- # @deprecated
823
- #
824
- # Negative partial compare arg1 and arg2
825
- #
826
- # @return [TrueClass, FalseClass]
827
- # If arg2 does not match/include arg1 return true, otherwise false
828
- def assert_no_partial_output(unexpected, actual)
829
- Aruba.platform.deprecated(
830
- 'The use of "#assert_no_partial_output" is deprecated.' \
831
- ' Use "expect(command).not_to have_output /partial/" instead.' \
832
- ' There are also special matchers for "stdout" and "stderr"'
833
- )
834
-
835
- actual.force_encoding(unexpected.encoding) if RUBY_VERSION >= "1.9"
836
- if Regexp === unexpected
837
- expect(Aruba.platform.unescape(actual, aruba.config.keep_ansi)).
838
- not_to match unexpected
839
- else
840
- expect(Aruba.platform.unescape(actual, aruba.config.keep_ansi)).
841
- not_to include(unexpected)
842
- end
843
- end
844
-
845
- # @deprecated
846
- #
847
- # Partial compare output of interactive command and arg1
848
- #
849
- # @return [TrueClass, FalseClass]
850
- # If output of interactive command includes arg1 return true, otherwise false
851
- def assert_partial_output_interactive(expected)
852
- Aruba.platform.deprecated(
853
- 'The use of "#assert_partial_output_interactive" is deprecated.' \
854
- ' Use "expect(last_command_started).to have_output /partial/" instead.' \
855
- ' There are also special matchers for "stdout" and "stderr"'
856
- )
857
-
858
- Aruba.platform.unescape(last_command_started.stdout, aruba.config.keep_ansi).
859
- include?(Aruba.platform.unescape(expected, aruba.config.keep_ansi))
860
- end
861
-
862
- # @deprecated
863
- #
864
- # Check if command succeeded and if arg1 is included in output
865
- #
866
- # @return [TrueClass, FalseClass]
867
- # If exit status is 0 and arg1 is included in output return true, otherwise false
868
- def assert_passing_with(expected)
869
- Aruba.platform.deprecated(
870
- 'The use of "#assert_passing_with" is deprecated.' \
871
- ' Use "expect(last_command_started).to be_successfully_executed"' \
872
- ' and expect(last_command_started).to have_output(/partial/)"' \
873
- ' or something similar instead.' \
874
- ' There are also special matchers for "stdout" and "stderr"'
875
- )
876
-
877
- assert_success(true)
878
- assert_partial_output(expected, all_output)
879
- end
880
-
881
- # @deprecated
882
- #
883
- # Check if command failed and if arg1 is included in output
884
- #
885
- # @return [TrueClass, FalseClass]
886
- # If exit status is not equal 0 and arg1 is included in output return
887
- # true, otherwise false
888
- def assert_failing_with(expected)
889
- Aruba.platform.deprecated(
890
- 'The use of "#assert_passing_with" is deprecated.' \
891
- ' Use "expect(last_command_started).not_to be_successfully_executed"' \
892
- ' and "expect(last_command_started).to have_output(/partial/)"' \
893
- ' or something similar instead.' \
894
- ' There are also special matchers for "stdout" and "stderr"'
895
- )
896
-
897
- assert_success(false)
898
- assert_partial_output(expected, all_output)
899
- end
900
-
901
- # @deprecated
902
- #
903
- # Check exit status of process
904
- #
905
- # @return [TrueClass, FalseClass]
906
- # If arg1 is true, return true if command was successful
907
- # If arg1 is false, return true if command failed
908
- def assert_success(success)
909
- Aruba.platform.deprecated(
910
- 'The use of "#assert_success" is deprecated.' \
911
- ' Use "expect(last_command_started).to be_successfully_executed" or' \
912
- ' with "not_to" or the negative form "have_failed_running"' \
913
- ' (requires rspec >= 3.1)'
914
- )
915
-
916
- if success
917
- expect(last_command_started).to be_successfully_executed
918
- else
919
- expect(last_command_started).not_to be_successfully_executed
920
- end
921
- end
922
-
923
- # @deprecated
924
- def assert_exit_status(status)
925
- Aruba.platform.deprecated(
926
- 'The use of "#assert_exit_status" is deprecated.' \
927
- ' Use "expect(last_command_started).to have_exit_status(status)"'
928
- )
929
-
930
- expect(last_command_started).to have_exit_status(status)
931
- end
932
-
933
- # @deprecated
934
- def assert_not_exit_status(status)
935
- Aruba.platform.deprecated(
936
- 'The use of "#assert_not_exit_status" is deprecated.' \
937
- ' Use "expect(last_command_started).not_to have_exit_status(status)"'
938
- )
939
-
940
- expect(last_exit_status).not_to eq(status),
941
- append_output_to("Exit status was #{last_exit_status} which was not expected.")
942
- end
943
-
944
- # @deprecated
945
- def append_output_to(message)
946
- Aruba.platform.deprecated(
947
- 'The use of "#append_output_to" is deprecated'
948
- )
949
-
950
- "#{message} Output:\n\n#{all_output}\n"
951
- end
952
-
953
- # @deprecated
954
- def register_process(*args)
955
- Aruba.platform.deprecated('The use of "#register_process" is deprecated')
956
-
957
- process_monitor.register_process(*args)
958
- end
959
-
960
- # @deprecated
961
- def get_process(wanted)
962
- Aruba.platform.deprecated('The use of "#get_process" is deprecated')
963
-
964
- process_monitor.get_process(wanted)
965
- end
966
-
967
- # @deprecated
968
- #
969
- # Fetch output (stdout, stderr) from command
970
- #
971
- # @param [String] cmd
972
- # The command
973
- def output_from(cmd)
974
- Aruba.platform.deprecated('The use of "#output_from" is deprecated')
975
-
976
- process_monitor.output_from(cmd)
977
- end
978
-
979
- # @deprecated
980
- #
981
- # Fetch stdout from command
982
- #
983
- # @param [String] cmd
984
- # The command
985
- def stdout_from(cmd)
986
- Aruba.platform.deprecated('The use of "#stdout_from" is deprecated')
987
-
988
- process_monitor.stdout_from(cmd)
989
- end
990
-
991
- # @deprecated
992
- #
993
- # Fetch stderr from command
994
- #
995
- # @param [String] cmd
996
- # The command
997
- def stderr_from(cmd)
998
- Aruba.platform.deprecated('The use of "#stderr_from" is deprecated')
999
-
1000
- process_monitor.stderr_from(cmd)
1001
- end
1002
-
1003
- # @deprecated
1004
- #
1005
- # Default exit timeout for running commands with aruba
1006
- #
1007
- # Overwrite this method if you want a different timeout or set
1008
- # `@aruba_timeout_seconds`.
1009
- def exit_timeout
1010
- Aruba.platform.deprecated(
1011
- 'The use of "#exit_timeout" is deprecated.' \
1012
- ' Use "aruba.config.exit_timeout" instead.'
1013
- )
1014
-
1015
- aruba.config.exit_timeout
1016
- end
1017
-
1018
- # @deprecated
1019
- #
1020
- # Default io wait timeout
1021
- #
1022
- # Overwrite this method if you want a different timeout or set
1023
- # `@aruba_io_wait_seconds
1024
- def io_wait
1025
- Aruba.platform.deprecated(
1026
- 'The use of "#io_wait" is deprecated.' \
1027
- ' Use "aruba.config.io_wait_timeout" instead'
1028
- )
1029
-
1030
- aruba.config.io_wait_timeout
1031
- end
1032
-
1033
- # @deprecated
1034
- # Only processes
1035
- def only_processes
1036
- Aruba.platform.deprecated(
1037
- 'The use of "#only_processes" is deprecated.' \
1038
- ' Use "#all_commands" instead'
1039
- )
1040
-
1041
- process_monitor.only_processes
1042
- end
1043
-
1044
- # @deprecated
1045
- def last_exit_status
1046
- Aruba.platform.deprecated(
1047
- 'The use of "#last_exit_status" is deprecated.' \
1048
- ' Use "#last_command_(started|stopped).exit_status" instead'
1049
- )
1050
-
1051
- process_monitor.last_exit_status
1052
- end
1053
-
1054
- # @deprecated
1055
- def stop_process(process)
1056
- Aruba.platform.deprecated(
1057
- 'The use of "#stop_process" is deprecated.' \
1058
- ' Use "#last_command_(started|stopped).stop" instead'
1059
- )
1060
-
1061
- @last_exit_status = process_monitor.stop_process(process)
1062
- end
1063
-
1064
- # @deprecated
1065
- def terminate_process(process)
1066
- Aruba.platform.deprecated(
1067
- 'The use of "#terminate_process" is deprecated.' \
1068
- ' Use "#last_command_(started|stopped).terminate" instead'
1069
- )
1070
-
1071
- process_monitor.terminate_process(process)
1072
- end
1073
-
1074
- # @deprecated
1075
- def stop_processes!
1076
- Aruba.platform.deprecated(
1077
- 'The use of "#stop_processes!" is deprecated.' \
1078
- ' Use "#stop_all_commands" instead'
1079
- )
1080
-
1081
- stop_all_commands
1082
- end
1083
-
1084
- # @deprecated
1085
- #
1086
- # Terminate all running processes
1087
- def terminate_processes!
1088
- Aruba.platform.deprecated(
1089
- 'The use of "#stop_processes!" is deprecated.' \
1090
- ' Use "all_commands.each(&:terminate)" instead'
1091
- )
1092
-
1093
- all_commands.each(&:terminate)
1094
- end
1095
-
1096
- # @deprecated
1097
- #
1098
- # Access to announcer
1099
- def announcer
1100
- Aruba.platform.deprecated(
1101
- 'The use of "#announcer" is deprecated.' \
1102
- ' Use "aruba.announcer" instead'
1103
- )
1104
-
1105
- @announcer ||= Platforms::Announcer.new(
1106
- self,
1107
- :stdout => defined?(@announce_stdout),
1108
- :stderr => defined?(@announce_stderr),
1109
- :dir => defined?(@announce_dir),
1110
- :cmd => defined?(@announce_cmd),
1111
- :env => defined?(@announce_env)
1112
- )
1113
-
1114
- @announcer
1115
- end
1116
-
1117
- # @deprecated
1118
- # Use a clean rvm gemset
1119
- #
1120
- # Please make sure that you've got [rvm](http://rvm.io/) installed.
1121
- #
1122
- # @param [String] gemset
1123
- # The name of the gemset to be used
1124
- def use_clean_gemset(gemset)
1125
- Aruba.platform.deprecated('The use of "#use_clean_gemset" is deprecated.')
1126
- run_simple(%{rvm gemset create "#{gemset}"}, true)
1127
- if all_stdout =~ /'#{gemset}' gemset created \((.*)\)\./
1128
- gem_home = Regexp.last_match[1]
1129
- set_environment_variable('GEM_HOME', gem_home)
1130
- set_environment_variable('GEM_PATH', gem_home)
1131
- set_environment_variable('BUNDLE_PATH', gem_home)
1132
-
1133
- paths = (ENV['PATH'] || "").split(File::PATH_SEPARATOR)
1134
- paths.unshift(File.join(gem_home, 'bin'))
1135
- set_environment_variable('PATH', paths.uniq.join(File::PATH_SEPARATOR))
1136
-
1137
- run_simple("gem install bundler", true)
1138
- else
1139
- raise "I didn't understand rvm's output: #{all_stdout}"
1140
- end
1141
- end
1142
-
1143
- # @private
1144
- # @deprecated
1145
- def process_monitor
1146
- Aruba.platform.deprecated('The use of "#process_monitor" is deprecated.')
1147
-
1148
- aruba.command_monitor
1149
- end
1150
-
1151
- # @private
1152
- # @deprecated
1153
- def processes
1154
- Aruba.platform.deprecated(
1155
- 'The use of "#process_monitor" is deprecated.' \
1156
- ' Use "#all_commands" instead.'
1157
- )
1158
-
1159
- aruba.command_monitor.send(:processes)
1160
- end
1161
- end
1162
- end
1163
- end