aruba 0.14.14 → 1.0.0.pre.alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (246) hide show
  1. checksums.yaml +5 -5
  2. data/.cucumberproignore +3 -0
  3. data/.github/ISSUE_TEMPLATE.md +48 -0
  4. data/.github/PULL_REQUEST_TEMPLATE.md +39 -0
  5. data/.gitignore +1 -0
  6. data/.rspec +1 -0
  7. data/.rubocop.yml +1 -5
  8. data/.travis.yml +35 -27
  9. data/CONTRIBUTING.md +131 -29
  10. data/Dockerfile +67 -0
  11. data/Gemfile +33 -80
  12. data/History.md +602 -0
  13. data/README.md +24 -196
  14. data/Rakefile +87 -27
  15. data/appveyor.yml +0 -1
  16. data/aruba.gemspec +30 -40
  17. data/bin/bootstrap +34 -0
  18. data/bin/build +3 -0
  19. data/{script → bin}/console +0 -0
  20. data/bin/release +3 -0
  21. data/bin/test +9 -0
  22. data/cucumber.yml +1 -3
  23. data/docker-compose.yml +26 -0
  24. data/{bin → exec}/aruba +0 -0
  25. data/fixtures/cli-app/README.md +1 -1
  26. data/fixtures/cli-app/features/support/aruba.rb +1 -0
  27. data/fixtures/cli-app/features/support/env.rb +1 -1
  28. data/fixtures/cli-app/lib/cli/app.rb +1 -5
  29. data/fixtures/cli-app/spec/spec_helper.rb +1 -6
  30. data/fixtures/empty-app/lib/cli/app.rb +2 -0
  31. data/lib/aruba/api.rb +3 -3
  32. data/lib/aruba/api/{commands.rb → command.rb} +4 -30
  33. data/lib/aruba/api/core.rb +8 -25
  34. data/lib/aruba/api/deprecated.rb +150 -408
  35. data/lib/aruba/api/filesystem.rb +17 -2
  36. data/lib/aruba/api/rvm.rb +44 -0
  37. data/lib/aruba/aruba_path.rb +56 -32
  38. data/lib/aruba/basic_configuration.rb +3 -5
  39. data/lib/aruba/colorizer.rb +99 -10
  40. data/lib/aruba/command.rb +0 -2
  41. data/lib/aruba/config.rb +5 -5
  42. data/lib/aruba/config/jruby.rb +5 -15
  43. data/lib/aruba/console.rb +2 -0
  44. data/lib/aruba/console/help.rb +1 -7
  45. data/lib/aruba/cucumber.rb +0 -2
  46. data/lib/aruba/cucumber/command.rb +98 -72
  47. data/lib/aruba/cucumber/file.rb +15 -3
  48. data/lib/aruba/cucumber/hooks.rb +71 -10
  49. data/lib/aruba/event_bus/name_resolver.rb +2 -10
  50. data/lib/aruba/generators/script_file.rb +1 -1
  51. data/lib/aruba/in_process.rb +0 -2
  52. data/lib/aruba/initializer.rb +4 -14
  53. data/lib/aruba/matchers/base/object_formatter.rb +0 -5
  54. data/lib/aruba/matchers/file/have_same_file_content.rb +5 -5
  55. data/lib/aruba/matchers/string/output_string_eq.rb +1 -1
  56. data/lib/aruba/platforms/announcer.rb +11 -16
  57. data/lib/aruba/platforms/aruba_file_creator.rb +1 -5
  58. data/lib/aruba/platforms/aruba_logger.rb +1 -5
  59. data/lib/aruba/platforms/command_monitor.rb +10 -14
  60. data/lib/aruba/platforms/determine_disk_usage.rb +8 -3
  61. data/lib/aruba/platforms/filesystem_status.rb +1 -5
  62. data/lib/aruba/platforms/unix_command_string.rb +1 -8
  63. data/lib/aruba/platforms/unix_environment_variables.rb +6 -8
  64. data/lib/aruba/platforms/unix_platform.rb +9 -22
  65. data/lib/aruba/platforms/unix_which.rb +4 -0
  66. data/lib/aruba/platforms/windows_command_string.rb +6 -14
  67. data/lib/aruba/platforms/windows_environment_variables.rb +4 -16
  68. data/lib/aruba/platforms/windows_which.rb +4 -0
  69. data/lib/aruba/processes/basic_process.rb +22 -18
  70. data/lib/aruba/processes/spawn_process.rb +12 -35
  71. data/lib/aruba/rspec.rb +1 -0
  72. data/lib/aruba/runtime.rb +3 -4
  73. data/lib/aruba/setup.rb +9 -11
  74. data/lib/aruba/spawn_process.rb +1 -4
  75. data/lib/aruba/tasks/docker_helpers.rb +158 -0
  76. data/lib/aruba/version.rb +1 -1
  77. metadata +62 -230
  78. data/CHANGELOG.md +0 -991
  79. data/features/.nav +0 -72
  80. data/features/01_getting_started_with_aruba/cleanup_working_directory.feature +0 -57
  81. data/features/01_getting_started_with_aruba/run_commands.feature +0 -217
  82. data/features/01_getting_started_with_aruba/supported_testing_frameworks.feature +0 -88
  83. data/features/02_configure_aruba/activate_announcer_on_command_failure.feature +0 -38
  84. data/features/02_configure_aruba/basics.feature +0 -151
  85. data/features/02_configure_aruba/command_runtime_environment.feature +0 -129
  86. data/features/02_configure_aruba/console_history_file.feature +0 -38
  87. data/features/02_configure_aruba/exit_timeout.feature +0 -60
  88. data/features/02_configure_aruba/fixtures_directories.feature +0 -38
  89. data/features/02_configure_aruba/fixtures_path_prefix.feature +0 -23
  90. data/features/02_configure_aruba/home_directory.feature +0 -80
  91. data/features/02_configure_aruba/io_timeout.feature +0 -30
  92. data/features/02_configure_aruba/keep_ansi.feature +0 -30
  93. data/features/02_configure_aruba/log_level.feature +0 -38
  94. data/features/02_configure_aruba/physical_block_size.feature +0 -53
  95. data/features/02_configure_aruba/remove_ansi_escape_sequences.feature +0 -38
  96. data/features/02_configure_aruba/root_directory.feature +0 -30
  97. data/features/02_configure_aruba/startup_wait_time.feature +0 -48
  98. data/features/02_configure_aruba/working_directory.feature +0 -38
  99. data/features/03_testing_frameworks/cucumber/announce_information_for_troubleshooting.feature +0 -306
  100. data/features/03_testing_frameworks/cucumber/disable_bunder.feature +0 -18
  101. data/features/03_testing_frameworks/cucumber/steps/command/check_for_exit_statuses.feature +0 -136
  102. data/features/03_testing_frameworks/cucumber/steps/command/check_output_of_command.feature +0 -514
  103. data/features/03_testing_frameworks/cucumber/steps/command/check_stderr_of_command.feature +0 -68
  104. data/features/03_testing_frameworks/cucumber/steps/command/check_stdout_of_command.feature +0 -109
  105. data/features/03_testing_frameworks/cucumber/steps/command/debug_your_command_in_aruba.feature +0 -118
  106. data/features/03_testing_frameworks/cucumber/steps/command/run_a_command.feature +0 -66
  107. data/features/03_testing_frameworks/cucumber/steps/command/run_command_in_process.feature +0 -485
  108. data/features/03_testing_frameworks/cucumber/steps/command/run_command_interactively.feature +0 -90
  109. data/features/03_testing_frameworks/cucumber/steps/command/run_commands_which_require_a_shell.feature +0 -79
  110. data/features/03_testing_frameworks/cucumber/steps/command/send_signal_to_command.feature +0 -83
  111. data/features/03_testing_frameworks/cucumber/steps/command/stop_command.feature +0 -285
  112. data/features/03_testing_frameworks/cucumber/steps/environment/append_environment_variable.feature +0 -52
  113. data/features/03_testing_frameworks/cucumber/steps/environment/modify_home_variable_for_testing.feature +0 -62
  114. data/features/03_testing_frameworks/cucumber/steps/environment/prepend_environment_variable.feature +0 -52
  115. data/features/03_testing_frameworks/cucumber/steps/environment/set_environment_variable.feature +0 -49
  116. data/features/03_testing_frameworks/cucumber/steps/filesystem/append_to_file.feature +0 -45
  117. data/features/03_testing_frameworks/cucumber/steps/filesystem/cd_to_directory.feature +0 -33
  118. data/features/03_testing_frameworks/cucumber/steps/filesystem/check_existence_of_directory.feature +0 -57
  119. data/features/03_testing_frameworks/cucumber/steps/filesystem/check_existence_of_file.feature +0 -43
  120. data/features/03_testing_frameworks/cucumber/steps/filesystem/check_file_content.feature +0 -143
  121. data/features/03_testing_frameworks/cucumber/steps/filesystem/check_non_existence_of_directory.feature +0 -69
  122. data/features/03_testing_frameworks/cucumber/steps/filesystem/check_non_existence_of_file.feature +0 -80
  123. data/features/03_testing_frameworks/cucumber/steps/filesystem/check_permissions_of_file.feature +0 -39
  124. data/features/03_testing_frameworks/cucumber/steps/filesystem/compare_files.feature +0 -42
  125. data/features/03_testing_frameworks/cucumber/steps/filesystem/copy_file_or_directory.feature +0 -45
  126. data/features/03_testing_frameworks/cucumber/steps/filesystem/create_directory.feature +0 -57
  127. data/features/03_testing_frameworks/cucumber/steps/filesystem/create_file.feature +0 -76
  128. data/features/03_testing_frameworks/cucumber/steps/filesystem/move_file_or_directory.feature +0 -44
  129. data/features/03_testing_frameworks/cucumber/steps/filesystem/overwrite_file.feature +0 -72
  130. data/features/03_testing_frameworks/cucumber/steps/filesystem/remove_directory.feature +0 -38
  131. data/features/03_testing_frameworks/cucumber/steps/filesystem/remove_file.feature +0 -38
  132. data/features/03_testing_frameworks/cucumber/steps/filesystem/use_fixtures_for_setup_test.feature +0 -77
  133. data/features/03_testing_frameworks/rspec/hooks/define_after_hook_for_commands.feature +0 -43
  134. data/features/03_testing_frameworks/rspec/hooks/define_before_hook_for_commands.feature +0 -71
  135. data/features/03_testing_frameworks/rspec/setup_aruba_for_rspec.feature +0 -179
  136. data/features/04_aruba_api/command/find_a_started_command.feature +0 -83
  137. data/features/04_aruba_api/command/find_command_in_PATH.feature +0 -37
  138. data/features/04_aruba_api/command/read_stderr_of_command.feature +0 -46
  139. data/features/04_aruba_api/command/read_stdout_of_command.feature +0 -46
  140. data/features/04_aruba_api/command/run_command.feature +0 -423
  141. data/features/04_aruba_api/command/run_simple.feature +0 -254
  142. data/features/04_aruba_api/command/send_signal_to_command.feature +0 -53
  143. data/features/04_aruba_api/command/stop_all_commands.feature +0 -57
  144. data/features/04_aruba_api/command/stop_single_command.feature +0 -132
  145. data/features/04_aruba_api/command/terminate_all_commands.feature +0 -57
  146. data/features/04_aruba_api/command/use_last_command_started.feature +0 -50
  147. data/features/04_aruba_api/command/use_last_command_stopped.feature +0 -89
  148. data/features/04_aruba_api/core/expand_path.feature +0 -88
  149. data/features/04_aruba_api/environment/append_environment_variable.feature +0 -128
  150. data/features/04_aruba_api/environment/delete_environment_variable.feature +0 -63
  151. data/features/04_aruba_api/environment/prepend_environment_variable.feature +0 -128
  152. data/features/04_aruba_api/environment/set_environment_variable.feature +0 -376
  153. data/features/04_aruba_api/filesystem/cd_to_directory.feature +0 -184
  154. data/features/04_aruba_api/filesystem/check_existence_file_or_directory.feature +0 -62
  155. data/features/04_aruba_api/filesystem/check_if_path_is_absolute.feature +0 -48
  156. data/features/04_aruba_api/filesystem/check_if_path_is_directory.feature +0 -53
  157. data/features/04_aruba_api/filesystem/check_if_path_is_file.feature +0 -54
  158. data/features/04_aruba_api/filesystem/check_if_path_is_relative.feature +0 -48
  159. data/features/04_aruba_api/filesystem/create_directory.feature +0 -57
  160. data/features/04_aruba_api/filesystem/move_file_or_directory.feature +0 -119
  161. data/features/04_aruba_api/filesystem/report_disk_usage.feature +0 -152
  162. data/features/04_aruba_api/filesystem/use_fixtures.feature +0 -104
  163. data/features/04_aruba_api/text/extract_text.feature +0 -87
  164. data/features/04_aruba_api/text/replace_variables.feature +0 -45
  165. data/features/04_aruba_api/text/sanitize_text.feature +0 -228
  166. data/features/04_aruba_api/text/unescape_text.feature +0 -127
  167. data/features/05_use_rspec_matchers/command/check_timeouts.feature +0 -48
  168. data/features/05_use_rspec_matchers/directory/have_sub_directory.feature +0 -110
  169. data/features/05_use_rspec_matchers/file/be_a_command_found_in_path.feature +0 -115
  170. data/features/05_use_rspec_matchers/file/be_existing_executable.feature +0 -88
  171. data/features/05_use_rspec_matchers/file/be_existing_file.feature +0 -82
  172. data/features/05_use_rspec_matchers/file/have_file_content.feature +0 -123
  173. data/features/05_use_rspec_matchers/file/have_file_size.feature +0 -107
  174. data/features/05_use_rspec_matchers/path/be_an_absolute_path.feature +0 -74
  175. data/features/05_use_rspec_matchers/path/be_an_existing_path.feature +0 -97
  176. data/features/05_use_rspec_matchers/path/have_permissions.feature +0 -118
  177. data/features/06_use_aruba_cli/initialize_project_with_aruba.feature +0 -79
  178. data/features/06_use_aruba_cli/open_console.feature +0 -55
  179. data/features/08_other/improve_performance_if_using_jruby.feature +0 -37
  180. data/features/step_definitions/hooks.rb +0 -146
  181. data/features/support/aruba.rb +0 -7
  182. data/features/support/env.rb +0 -33
  183. data/features/support/simplecov_setup.rb +0 -11
  184. data/lib/aruba/api/bundler.rb +0 -16
  185. data/lib/aruba/cucumber/deprecated.rb +0 -93
  186. data/lib/aruba/matchers/deprecated.rb +0 -1
  187. data/lib/aruba/matchers/deprecated/file.rb +0 -17
  188. data/lib/aruba/reporting.rb +0 -126
  189. data/script/bootstrap +0 -24
  190. data/script/test +0 -3
  191. data/spec/aruba/api/bundler_spec.rb +0 -15
  192. data/spec/aruba/api/commands_spec.rb +0 -30
  193. data/spec/aruba/api/core_spec.rb +0 -184
  194. data/spec/aruba/api/deprecated_spec.rb +0 -421
  195. data/spec/aruba/api/filesystem_spec.rb +0 -746
  196. data/spec/aruba/api/runtime_spec.rb +0 -28
  197. data/spec/aruba/api_spec.rb +0 -73
  198. data/spec/aruba/aruba_path_spec.rb +0 -103
  199. data/spec/aruba/basic_configuration_spec.rb +0 -5
  200. data/spec/aruba/configuration_spec.rb +0 -5
  201. data/spec/aruba/hooks_spec.rb +0 -17
  202. data/spec/aruba/in_config_wrapper_spec.rb +0 -25
  203. data/spec/aruba/jruby_spec.rb +0 -73
  204. data/spec/aruba/matchers/command/have_output_size_spec.rb +0 -25
  205. data/spec/aruba/matchers/command_spec.rb +0 -174
  206. data/spec/aruba/matchers/deprecated_spec.rb +0 -120
  207. data/spec/aruba/matchers/directory_spec.rb +0 -57
  208. data/spec/aruba/matchers/file_spec.rb +0 -208
  209. data/spec/aruba/matchers/path_spec.rb +0 -58
  210. data/spec/aruba/platform/simple_table_spec.rb +0 -23
  211. data/spec/aruba/platform/windows_environment_variables_spec.rb +0 -500
  212. data/spec/aruba/platforms/unix_command_string_spec.rb +0 -17
  213. data/spec/aruba/platforms/windows_command_string_spec.rb +0 -22
  214. data/spec/aruba/processes/spawn_process_spec.rb +0 -112
  215. data/spec/aruba/rspec_spec.rb +0 -15
  216. data/spec/aruba/runtime_spec.rb +0 -29
  217. data/spec/event_bus/name_resolver_spec.rb +0 -68
  218. data/spec/event_bus_spec.rb +0 -158
  219. data/spec/spec_helper.rb +0 -22
  220. data/spec/support/configs/.keep +0 -0
  221. data/spec/support/configs/aruba.rb +0 -5
  222. data/spec/support/configs/pry.rb +0 -3
  223. data/spec/support/configs/rspec.rb +0 -15
  224. data/spec/support/helpers/.keep +0 -0
  225. data/spec/support/helpers/reporting.rb +0 -44
  226. data/spec/support/matchers/.keep +0 -0
  227. data/spec/support/matchers/option.rb +0 -35
  228. data/spec/support/shared_contexts/.keep +0 -0
  229. data/spec/support/shared_contexts/aruba.rb +0 -49
  230. data/spec/support/shared_examples/.keep +0 -0
  231. data/spec/support/shared_examples/configuration.rb +0 -116
  232. data/spec/support/shared_examples/directory.rb +0 -7
  233. data/spec/support/shared_examples/file.rb +0 -7
  234. data/templates/css/console.css +0 -24
  235. data/templates/css/filesystem.css +0 -42
  236. data/templates/css/pygments-autumn.css +0 -59
  237. data/templates/files.erb +0 -14
  238. data/templates/images/LICENSE +0 -22
  239. data/templates/images/folder.png +0 -0
  240. data/templates/images/page_white.png +0 -0
  241. data/templates/images/page_white_gherkin.png +0 -0
  242. data/templates/images/page_white_ruby.png +0 -0
  243. data/templates/index.erb +0 -20
  244. data/templates/js/filesystem.js +0 -5
  245. data/templates/js/jquery-1.11.3.min.js +0 -5
  246. data/templates/main.erb +0 -34
@@ -1,18 +0,0 @@
1
- Feature: Disable Bundler environment
2
- Use the @disable-bundler tag to escape from your project's Gemfile.
3
-
4
- Background:
5
- Given I use the fixture "cli-app"
6
-
7
- Scenario: Clear the Bundler environment
8
-
9
- Given a file named "features/run.feature" with:
10
- """
11
- Feature: My Feature
12
- @disable-bundler
13
- Scenario: Check environment
14
- When I run `env`
15
- Then the output should not match /^BUNDLE_GEMFILE=/
16
- """
17
- When I run `cucumber`
18
- Then the features should all pass
@@ -1,136 +0,0 @@
1
- Feature: Check exit status of commands
2
-
3
- Use the `the exit status should be \d`-step to check the exit status of the
4
- last command which was executed.
5
-
6
- Background:
7
- Given I use a fixture named "cli-app"
8
-
9
- Scenario: Test for exit status of 0
10
- Given an executable named "bin/aruba-test-cli" with:
11
- """
12
- #!/bin/bash
13
- exit 0
14
- """
15
- And a file named "features/exit_status.feature" with:
16
- """
17
- Feature: Exit status
18
- Scenario: Run command
19
- When I run `aruba-test-cli`
20
- Then the exit status should be 0
21
- """
22
- When I run `cucumber`
23
- Then the features should all pass
24
-
25
- Scenario: Test for exit status 1
26
- Given an executable named "bin/aruba-test-cli" with:
27
- """
28
- #!/bin/bash
29
- exit 1
30
- """
31
- And a file named "features/exit_status.feature" with:
32
- """
33
- Feature: Failing program
34
- Scenario: Run command
35
- When I run `aruba-test-cli`
36
- Then the exit status should be 1
37
- """
38
- When I run `cucumber`
39
- Then the features should all pass
40
-
41
- Scenario: Test for non-zero exit status
42
- Given an executable named "bin/aruba-test-cli" with:
43
- """
44
- #!/bin/bash
45
- exit 1
46
- """
47
- And a file named "features/exit_status.feature" with:
48
- """
49
- Feature: Failing program
50
- Scenario: Run command
51
- When I run `aruba-test-cli`
52
- Then the exit status should not be 0
53
- """
54
- When I run `cucumber`
55
- Then the features should all pass
56
-
57
- Scenario: Successfully run something
58
- Given an executable named "bin/aruba-test-cli" with:
59
- """
60
- #!/bin/bash
61
- exit 0
62
- """
63
- And a file named "features/exit_status.feature" with:
64
- """
65
- Feature: Failing program
66
- Scenario: Run command
67
- When I successfully run `aruba-test-cli`
68
- """
69
- When I run `cucumber`
70
- Then the features should all pass
71
-
72
- Scenario: Fail to run something successfully
73
- Given an executable named "bin/aruba-test-cli" with:
74
- """
75
- #!/bin/bash
76
- exit 1
77
- """
78
- And a file named "features/exit_status.feature" with:
79
- """
80
- Feature: Failing program
81
- Scenario: Run command
82
- When I successfully run `aruba-test-cli`
83
- """
84
- When I run `cucumber`
85
- Then the features should not all pass
86
-
87
- Scenario: Overwrite the default exit timeout via step
88
- Given an executable named "bin/aruba-test-cli" with:
89
- """
90
- #!/bin/bash
91
- sleep 0.1
92
- """
93
- And a file named "features/exit_status.feature" with:
94
- """
95
- Feature: Failing program
96
- Scenario: Run command
97
- Given the default aruba exit timeout is 0.2 seconds
98
- When I successfully run `aruba-test-cli`
99
- """
100
- When I run `cucumber`
101
- Then the features should all pass
102
-
103
- Scenario: Successfully run something longer then the default time
104
- Given an executable named "bin/aruba-test-cli" with:
105
- """
106
- #!/bin/bash
107
- sleep 0.1
108
- """
109
- And a file named "features/exit_status.feature" with:
110
- """
111
- Feature: Failing program
112
- Scenario: Run command
113
- Given the default aruba exit timeout is 0 seconds
114
- When I successfully run `aruba-test-cli` for up to 0.2 seconds
115
- """
116
- When I run `cucumber`
117
- Then the features should all pass
118
-
119
- Scenario: Unsuccessfully run something that takes too long
120
- Given an executable named "bin/aruba-test-cli" with:
121
- """
122
- #!/bin/bash
123
- sleep 2
124
- """
125
- And a file named "features/exit_status.feature" with:
126
- """
127
- Feature: Failing program
128
- Scenario: Run command
129
- Given the default aruba exit timeout is 0 seconds
130
- When I successfully run `aruba-test-cli` for up to 1 seconds
131
- """
132
- When I run `cucumber`
133
- Then the features should not all pass with:
134
- """
135
- expected "aruba-test-cli" to have finished in time
136
- """
@@ -1,514 +0,0 @@
1
- Feature: All output of commands which were executed
2
-
3
- In order to specify expected output
4
- As a developer using Cucumber
5
- I want to use the "the output should contain" step
6
-
7
- Background:
8
- Given I use a fixture named "cli-app"
9
-
10
- Scenario: Detect subset of one-line output
11
- Given an executable named "bin/aruba-test-cli" with:
12
- """bash
13
- #!/usr/bin/env bash
14
-
15
- echo 'hello world'
16
- """
17
- And a file named "features/output.feature" with:
18
- """cucumber
19
- Feature: Run command
20
- Scenario: Run command
21
- When I run `aruba-test-cli`
22
- Then the output should contain "hello world"
23
- """
24
- When I run `cucumber`
25
- Then the features should all pass
26
-
27
- Scenario: Detect absence of one-line output
28
- Given an executable named "bin/aruba-test-cli" with:
29
- """bash
30
- #!/usr/bin/env bash
31
-
32
- echo 'hello world'
33
- """
34
- And a file named "features/output.feature" with:
35
- """cucumber
36
- Feature: Run command
37
- Scenario: Run command
38
- When I run `aruba-test-cli`
39
- Then the output should not contain "good-bye"
40
- """
41
- When I run `cucumber`
42
- Then the features should all pass
43
-
44
- Scenario: Detect subset of multiline output
45
- Given an executable named "bin/aruba-test-cli" with:
46
- """bash
47
- #!/usr/bin/env bash
48
-
49
- echo -e "hello\nworld"
50
- """
51
- And a file named "features/output.feature" with:
52
- """cucumber
53
- Feature: Run command
54
- Scenario: Run command
55
- When I run `aruba-test-cli`
56
- Then the output should contain:
57
- \"\"\"
58
- hello
59
- \"\"\"
60
- """
61
- When I run `cucumber`
62
- Then the features should all pass
63
-
64
- Scenario: Detect absence of subset of multiline output
65
- Given an executable named "bin/aruba-test-cli" with:
66
- """bash
67
- #!/usr/bin/env bash
68
-
69
- echo -e "hello\nworld"
70
- """
71
- And a file named "features/output.feature" with:
72
- """cucumber
73
- Feature: Run command
74
- Scenario: Run command
75
- When I run `aruba-test-cli`
76
- Then the output should not contain:
77
- \"\"\"
78
- good-bye
79
- \"\"\"
80
- """
81
- When I run `cucumber`
82
- Then the features should all pass
83
-
84
- Scenario: Detect exact one-line output
85
- Given a file named "features/output.feature" with:
86
- """cucumber
87
- Feature: Run command
88
- Scenario: Run command
89
- When I run `echo 'hello world'`
90
- Then the output should contain exactly:
91
- \"\"\"
92
- hello world
93
- \"\"\"
94
- """
95
- When I run `cucumber`
96
- Then the features should all pass
97
-
98
- Scenario: Detect exact one-line output with ANSI output
99
- Given an executable named "bin/aruba-test-cli" with:
100
- """bash
101
- #!/usr/bin/env bash
102
-
103
- echo -e "\e[36mhello world\e[0m"
104
- """
105
- And a file named "features/output.feature" with:
106
- """cucumber
107
- Feature: Run command
108
- @keep-ansi-escape-sequences
109
- Scenario: Run command
110
- When I run `aruba-test-cli`
111
- Then the output should contain exactly:
112
- \"\"\"
113
- \e[36mhello world\e[0m
114
- \"\"\"
115
- """
116
- When I run `cucumber`
117
- Then the features should all pass
118
-
119
- Scenario: Detect exact one-line output with ANSI output stripped by default
120
- Given the default aruba exit timeout is 12 seconds
121
- Given an executable named "bin/aruba-test-cli" with:
122
- """bash
123
- #!/usr/bin/env bash
124
-
125
- echo -e "\e[36mhello world\e[0m"
126
- """
127
- And a file named "features/output.feature" with:
128
- """cucumber
129
- Feature: Run command
130
- Scenario: Run command
131
- When I run `aruba-test-cli`
132
- Then the output should contain exactly:
133
- \"\"\"
134
- hello world
135
- \"\"\"
136
- """
137
- When I run `cucumber`
138
- Then the features should all pass
139
-
140
- Scenario: Detect exact multiline output
141
- Given an executable named "bin/aruba-test-cli" with:
142
- """bash
143
- #!/usr/bin/env bash
144
-
145
- echo -ne "hello\nworld"
146
- """
147
- And a file named "features/output.feature" with:
148
- """cucumber
149
- Feature: Run command
150
- Scenario: Run command
151
- When I run `aruba-test-cli`
152
- Then the output should contain exactly:
153
- \"\"\"
154
- hello
155
- world
156
- \"\"\"
157
- """
158
- When I run `cucumber`
159
- Then the features should all pass
160
-
161
- Scenario: Detect subset of one-line output with regex
162
- Given an executable named "bin/aruba-test-cli" with:
163
- """bash
164
- #!/usr/bin/env bash
165
-
166
- echo 'hello, ruby'
167
- """
168
- And a file named "features/output.feature" with:
169
- """cucumber
170
- Feature: Run command
171
- Scenario: Run command
172
- When I run `aruba-test-cli`
173
- Then the output should match /^hello(, world)?/
174
- """
175
- When I run `cucumber`
176
- Then the features should all pass
177
-
178
- Scenario: Detect subset of multiline output with regex
179
- Given an executable named "bin/aruba-test-cli" with:
180
- """bash
181
- #!/usr/bin/env bash
182
-
183
- echo -e "hello\nworld\nextra line1\nextra line2\nimportant line"
184
- """
185
- And a file named "features/output.feature" with:
186
- """cucumber
187
- Feature: Run command
188
- Scenario: Run command
189
- When I run `aruba-test-cli`
190
- Then the output should match:
191
- \"\"\"
192
- he..o
193
- wor.d
194
- .*
195
- important line
196
- \"\"\"
197
- """
198
- When I run `cucumber`
199
- Then the features should all pass
200
-
201
- Scenario: Negative matching of one-line output with regex
202
- Given an executable named "bin/aruba-test-cli" with:
203
- """bash
204
- #!/usr/bin/env bash
205
-
206
- echo "hello, ruby"
207
- """
208
- And a file named "features/output.feature" with:
209
- """cucumber
210
- Feature: Run command
211
- Scenario: Run command
212
- When I run `aruba-test-cli`
213
- Then the output should not match /ruby is a better perl$/
214
- """
215
- When I run `cucumber`
216
- Then the features should all pass
217
-
218
- Scenario: Negative matching of multiline output with regex
219
- Given an executable named "bin/aruba-test-cli" with:
220
- """bash
221
- #!/usr/bin/env bash
222
-
223
- echo -e "hello\nworld\nextra line1\nextra line2\nimportant line"
224
- """
225
- And a file named "features/output.feature" with:
226
- """cucumber
227
- Feature: Run command
228
- Scenario: Run command
229
- When I run `aruba-test-cli`
230
- Then the output should not match:
231
- \"\"\"
232
- ruby
233
- is
234
- a
235
- .*
236
- perl
237
- \"\"\"
238
- """
239
- When I run `cucumber`
240
- Then the features should all pass
241
-
242
- Scenario: Match passing exit status and partial output
243
- Given an executable named "bin/aruba-test-cli" with:
244
- """bash
245
- #!/usr/bin/env bash
246
-
247
- echo "hello world"
248
- exit 0
249
- """
250
- And a file named "features/output.feature" with:
251
- """cucumber
252
- Feature: Run command
253
- Scenario: Run command
254
- When I run `aruba-test-cli`
255
- Then it should pass with:
256
- \"\"\"
257
- hello
258
- \"\"\"
259
- """
260
- When I run `cucumber`
261
- Then the features should all pass
262
-
263
- Scenario: Match passing exit status and exact output
264
- Given an executable named "bin/aruba-test-cli" with:
265
- """bash
266
- #!/usr/bin/env bash
267
-
268
- echo -ne "hello\nworld"
269
- exit 0
270
- """
271
- And a file named "features/output.feature" with:
272
- """cucumber
273
- Feature: Run command
274
- Scenario: Run command
275
- When I run `aruba-test-cli`
276
- Then it should pass with exactly:
277
- \"\"\"
278
- hello
279
- world
280
- \"\"\"
281
- """
282
- When I run `cucumber`
283
- Then the features should all pass
284
-
285
- Scenario: Match failing exit status and partial output
286
- Given an executable named "bin/aruba-test-cli" with:
287
- """bash
288
- #!/usr/bin/env bash
289
-
290
- echo -e "hello\nworld"
291
- exit 1
292
- """
293
- And a file named "features/output.feature" with:
294
- """cucumber
295
- Feature: Run command
296
- Scenario: Run command
297
- When I run `aruba-test-cli`
298
- Then it should fail with:
299
- \"\"\"
300
- hello
301
- \"\"\"
302
- """
303
- When I run `cucumber`
304
- Then the features should all pass
305
-
306
-
307
- Scenario: Match failing exit status and exact output
308
- Given an executable named "bin/aruba-test-cli" with:
309
- """bash
310
- #!/usr/bin/env bash
311
-
312
- echo -e "hello\nworld"
313
- exit 1
314
- """
315
- And a file named "features/output.feature" with:
316
- """cucumber
317
- Feature: Run command
318
- Scenario: Run command
319
- When I run `aruba-test-cli`
320
- Then it should fail with:
321
- \"\"\"
322
- hello
323
- world
324
- \"\"\"
325
- """
326
- When I run `cucumber`
327
- Then the features should all pass
328
-
329
- Scenario: Match failing exit status and output with regex
330
- Given an executable named "bin/aruba-test-cli" with:
331
- """bash
332
- #!/usr/bin/env bash
333
-
334
- echo -e "hello\nworld"
335
- exit 1
336
- """
337
- And a file named "features/output.feature" with:
338
- """cucumber
339
- Feature: Run command
340
- Scenario: Run command
341
- When I run `aruba-test-cli`
342
- Then it should fail with regex:
343
- \"\"\"
344
- hello\s*world
345
- \"\"\"
346
- """
347
- When I run `cucumber`
348
- Then the features should all pass
349
-
350
- Scenario: Detect output from all processes
351
- Given an executable named "bin/aruba-test-cli1" with:
352
- """bash
353
- #!/usr/bin/env bash
354
-
355
- echo 'This is cli1'
356
- """
357
- And an executable named "bin/aruba-test-cli2" with:
358
- """bash
359
- #!/usr/bin/env bash
360
-
361
- echo 'This is cli2'
362
- """
363
- And a file named "features/output.feature" with:
364
- """cucumber
365
- Feature: Run command
366
- Scenario: Run command
367
- When I run `aruba-test-cli1`
368
- When I run `aruba-test-cli2`
369
- Then the stdout should contain exactly:
370
- \"\"\"
371
- This is cli1
372
- This is cli2
373
- \"\"\"
374
- """
375
- When I run `cucumber`
376
- Then the features should all pass
377
-
378
- Scenario: Detect combined output from normal and interactive processes
379
- Given an executable named "bin/aruba-test-cli1" with:
380
- """
381
- #!/usr/bin/env bash
382
- echo 'This is cli1'
383
- """
384
- And an executable named "bin/aruba-test-cli2" with:
385
- """
386
- #!/usr/bin/env ruby
387
-
388
- while input = gets do
389
- break if "" == input
390
- puts input
391
- end
392
- """
393
- And a file named "features/output.feature" with:
394
- """
395
- Feature: Run command
396
- Scenario: Run command
397
- When I run `aruba-test-cli1`
398
- When I run `aruba-test-cli2` interactively
399
- And I type "This is cli2"
400
- And I type ""
401
- Then the stdout should contain exactly:
402
- \"\"\"
403
- This is cli1
404
- This is cli2
405
- \"\"\"
406
- """
407
- When I run `cucumber`
408
- Then the features should all pass
409
-
410
- Scenario: Handle little output
411
- Given an executable named "bin/aruba-test-cli" with:
412
- """bash
413
- #!/usr/bin/env bash
414
-
415
- for ((c=0; c<256; c = c+1)); do
416
- echo -n "a"
417
- done
418
- """
419
- And a file named "features/flushing.feature" with:
420
- """cucumber
421
- Feature: Flushing output
422
- Scenario: Run command
423
- When I run `aruba-test-cli`
424
- Then the output should contain "a"
425
- And the output should be 256 bytes long
426
- And the exit status should be 0
427
- """
428
- When I run `cucumber`
429
- Then the features should all pass
430
-
431
- Scenario: Handle tons of output
432
-
433
- In order to test processes that output a lot of data
434
- As a developer using Aruba
435
- I want to make sure that large amounts of output aren't buffered
436
-
437
- Given the default aruba exit timeout is 10 seconds
438
- And an executable named "bin/aruba-test-cli" with:
439
- """bash
440
- #!/usr/bin/env bash
441
-
442
- for ((c=0; c<65536; c = c+1)); do
443
- echo -n "a"
444
- done
445
- """
446
- And a file named "features/flushing.feature" with:
447
- """cucumber
448
- Feature: Flushing output
449
- Scenario: Run command
450
- When I run `aruba-test-cli`
451
- Then the output should contain "a"
452
- And the output should be 65536 bytes long
453
- And the exit status should be 0
454
- """
455
- When I run `cucumber`
456
- Then the features should all pass
457
-
458
- Scenario: Handle tons of interactive output
459
- Given the default aruba exit timeout is 10 seconds
460
- And an executable named "bin/aruba-test-cli" with:
461
- """bash
462
- #!/usr/bin/env bash
463
-
464
- read size; for ((c=0; c<$size; c = c+1)); do
465
- echo -n "a"
466
- done
467
- """
468
- And a file named "features/flushing.feature" with:
469
- """cucumber
470
- Feature: Flushing output
471
- Scenario: Run command
472
- When I run `aruba-test-cli` interactively
473
- And I type "65536"
474
- Then the output should contain "a"
475
- And the output should be 65536 bytes long
476
- And the exit status should be 0
477
- """
478
- When I run `cucumber`
479
- Then the features should all pass
480
-
481
- Scenario: Detect output from named source
482
- Given a file named "features/output.feature" with:
483
- """
484
- Feature: Run command
485
- Scenario: Run command
486
- When I run `printf 'simple'`
487
- And I run `cat` interactively
488
- And I type "interactive"
489
- And I type ""
490
- Then the output from "printf 'simple'" should contain "simple"
491
- And the output from "printf 'simple'" should contain exactly "simple"
492
- And the output from "printf 'simple'" should contain exactly:
493
- \"\"\"
494
- simple
495
- \"\"\"
496
- And the output from "cat" should not contain "simple"
497
- """
498
- When I run `cucumber`
499
- Then the features should all pass
500
-
501
- Scenario: Detect second output from named source with custom name
502
- Given a file named "features/output.feature" with:
503
- """
504
- Feature: Run command
505
- Scenario: Run command
506
- When I set the environment variable "ARUBA_TEST_VAR" to "first"
507
- And I run `bash -c 'printf $ARUBA_TEST_VAR'`
508
- Then the output from "bash -c 'printf $ARUBA_TEST_VAR'" should contain "first"
509
- When I set the environment variable "ARUBA_TEST_VAR" to "second"
510
- And I run `bash -c 'printf $ARUBA_TEST_VAR'`
511
- Then the output from "bash -c 'printf $ARUBA_TEST_VAR'" should contain "second"
512
- """
513
- When I run `cucumber`
514
- Then the features should all pass