aruba 0.14.9 → 0.14.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +2 -0
  3. data/.travis.yml +17 -37
  4. data/CHANGELOG.md +30 -0
  5. data/Gemfile +11 -1
  6. data/features/{getting_started/cleanup.feature → 01_getting_started_with_aruba/cleanup_working_directory.feature} +4 -5
  7. data/features/{getting_started → 01_getting_started_with_aruba}/run_commands.feature +45 -15
  8. data/features/{getting_started → 01_getting_started_with_aruba}/supported_testing_frameworks.feature +5 -21
  9. data/features/{configuration → 02_configure_aruba}/activate_announcer_on_command_failure.feature +2 -2
  10. data/features/{configuration/usage.feature → 02_configure_aruba/basics.feature} +21 -29
  11. data/features/{configuration → 02_configure_aruba}/command_runtime_environment.feature +0 -0
  12. data/features/{configuration → 02_configure_aruba}/console_history_file.feature +2 -2
  13. data/features/{configuration → 02_configure_aruba}/exit_timeout.feature +25 -17
  14. data/features/{configuration → 02_configure_aruba}/fixtures_directories.feature +2 -2
  15. data/features/{configuration → 02_configure_aruba}/fixtures_path_prefix.feature +1 -1
  16. data/features/{configuration → 02_configure_aruba}/home_directory.feature +6 -6
  17. data/features/{configuration → 02_configure_aruba}/io_timeout.feature +2 -2
  18. data/features/{configuration → 02_configure_aruba}/keep_ansi.feature +0 -0
  19. data/features/{configuration → 02_configure_aruba}/log_level.feature +2 -2
  20. data/features/{configuration → 02_configure_aruba}/physical_block_size.feature +3 -3
  21. data/features/{configuration → 02_configure_aruba}/remove_ansi_escape_sequences.feature +2 -2
  22. data/features/{configuration → 02_configure_aruba}/root_directory.feature +1 -1
  23. data/features/{configuration → 02_configure_aruba}/startup_wait_time.feature +2 -2
  24. data/features/{configuration → 02_configure_aruba}/working_directory.feature +9 -4
  25. data/features/{steps/core/announce.feature → 03_testing_frameworks/cucumber/announce_information_for_troubleshooting.feature} +20 -40
  26. data/features/{steps/environment → 03_testing_frameworks/cucumber}/disable_bunder.feature +0 -0
  27. data/features/{steps/command/exit_statuses.feature → 03_testing_frameworks/cucumber/steps/command/check_for_exit_statuses.feature} +20 -20
  28. data/features/{steps/command/output.feature → 03_testing_frameworks/cucumber/steps/command/check_output_of_command.feature} +58 -111
  29. data/features/{steps/command/stderr.feature → 03_testing_frameworks/cucumber/steps/command/check_stderr_of_command.feature} +1 -1
  30. data/features/{steps/command/stdout.feature → 03_testing_frameworks/cucumber/steps/command/check_stdout_of_command.feature} +6 -6
  31. data/features/{steps/command/debug.feature → 03_testing_frameworks/cucumber/steps/command/debug_your_command_in_aruba.feature} +6 -6
  32. data/features/{steps/command/run.feature → 03_testing_frameworks/cucumber/steps/command/run_a_command.feature} +4 -4
  33. data/features/{steps/command/in_process.feature → 03_testing_frameworks/cucumber/steps/command/run_command_in_process.feature} +2 -2
  34. data/features/{steps/command/interactive.feature → 03_testing_frameworks/cucumber/steps/command/run_command_interactively.feature} +2 -2
  35. data/features/03_testing_frameworks/cucumber/steps/command/run_commands_which_require_a_shell.feature +79 -0
  36. data/features/{steps/command/send_signal.feature → 03_testing_frameworks/cucumber/steps/command/send_signal_to_command.feature} +19 -40
  37. data/features/{steps/command/stop.feature → 03_testing_frameworks/cucumber/steps/command/stop_command.feature} +47 -75
  38. data/features/{steps → 03_testing_frameworks/cucumber/steps}/environment/append_environment_variable.feature +3 -3
  39. data/features/{steps/environment/home_variable.feature → 03_testing_frameworks/cucumber/steps/environment/modify_home_variable_for_testing.feature} +4 -4
  40. data/features/{steps → 03_testing_frameworks/cucumber/steps}/environment/prepend_environment_variable.feature +3 -3
  41. data/features/{steps → 03_testing_frameworks/cucumber/steps}/environment/set_environment_variable.feature +3 -3
  42. data/features/{steps → 03_testing_frameworks/cucumber/steps}/filesystem/append_to_file.feature +0 -0
  43. data/features/{steps → 03_testing_frameworks/cucumber/steps}/filesystem/cd_to_directory.feature +0 -0
  44. data/features/{steps/filesystem/existence_of_directory.feature → 03_testing_frameworks/cucumber/steps/filesystem/check_existence_of_directory.feature} +0 -0
  45. data/features/{steps/filesystem/existence_of_file.feature → 03_testing_frameworks/cucumber/steps/filesystem/check_existence_of_file.feature} +0 -0
  46. data/features/{steps/filesystem/file_content.feature → 03_testing_frameworks/cucumber/steps/filesystem/check_file_content.feature} +57 -0
  47. data/features/{steps/filesystem/non_existence_of_directory.feature → 03_testing_frameworks/cucumber/steps/filesystem/check_non_existence_of_directory.feature} +0 -0
  48. data/features/{steps/filesystem/non_existence_of_file.feature → 03_testing_frameworks/cucumber/steps/filesystem/check_non_existence_of_file.feature} +0 -0
  49. data/features/{steps → 03_testing_frameworks/cucumber/steps}/filesystem/check_permissions_of_file.feature +0 -0
  50. data/features/{steps → 03_testing_frameworks/cucumber/steps}/filesystem/compare_files.feature +0 -0
  51. data/features/{steps/filesystem/copy.feature → 03_testing_frameworks/cucumber/steps/filesystem/copy_file_or_directory.feature} +0 -0
  52. data/features/{steps → 03_testing_frameworks/cucumber/steps}/filesystem/create_directory.feature +0 -0
  53. data/features/{steps → 03_testing_frameworks/cucumber/steps}/filesystem/create_file.feature +0 -0
  54. data/features/{steps/filesystem/move.feature → 03_testing_frameworks/cucumber/steps/filesystem/move_file_or_directory.feature} +0 -1
  55. data/features/{steps → 03_testing_frameworks/cucumber/steps}/filesystem/overwrite_file.feature +0 -0
  56. data/features/{steps → 03_testing_frameworks/cucumber/steps}/filesystem/remove_directory.feature +0 -0
  57. data/features/{steps → 03_testing_frameworks/cucumber/steps}/filesystem/remove_file.feature +0 -0
  58. data/features/{steps/filesystem/use_fixture.feature → 03_testing_frameworks/cucumber/steps/filesystem/use_fixtures_for_setup_test.feature} +0 -0
  59. data/features/{hooks/after/command.feature → 03_testing_frameworks/rspec/hooks/define_after_hook_for_commands.feature} +1 -4
  60. data/features/{hooks/before/command.feature → 03_testing_frameworks/rspec/hooks/define_before_hook_for_commands.feature} +1 -5
  61. data/features/{rspec/integration.feature → 03_testing_frameworks/rspec/setup_aruba_for_rspec.feature} +17 -17
  62. data/features/{api/command/find_command.feature → 04_aruba_api/command/find_a_started_command.feature} +0 -0
  63. data/features/{api/command/which.feature → 04_aruba_api/command/find_command_in_PATH.feature} +4 -4
  64. data/features/{api/command/stderr.feature → 04_aruba_api/command/read_stderr_of_command.feature} +8 -8
  65. data/features/{api/command/stdout.feature → 04_aruba_api/command/read_stdout_of_command.feature} +7 -7
  66. data/features/{api/command/run.feature → 04_aruba_api/command/run_command.feature} +53 -44
  67. data/features/{api → 04_aruba_api}/command/run_simple.feature +46 -34
  68. data/features/{api/command/send_signal.feature → 04_aruba_api/command/send_signal_to_command.feature} +8 -8
  69. data/features/{api → 04_aruba_api}/command/stop_all_commands.feature +18 -14
  70. data/features/{api/command/stop.feature → 04_aruba_api/command/stop_single_command.feature} +19 -18
  71. data/features/{api → 04_aruba_api}/command/terminate_all_commands.feature +16 -12
  72. data/features/{api/command/last_command_started.feature → 04_aruba_api/command/use_last_command_started.feature} +0 -0
  73. data/features/{api/command/last_command_stopped.feature → 04_aruba_api/command/use_last_command_stopped.feature} +2 -2
  74. data/features/{api → 04_aruba_api}/core/expand_path.feature +0 -0
  75. data/features/{api → 04_aruba_api}/environment/append_environment_variable.feature +0 -0
  76. data/features/{api → 04_aruba_api}/environment/delete_environment_variable.feature +0 -0
  77. data/features/{api → 04_aruba_api}/environment/prepend_environment_variable.feature +0 -0
  78. data/features/{api → 04_aruba_api}/environment/set_environment_variable.feature +0 -0
  79. data/features/{api/filesystem/cd.feature → 04_aruba_api/filesystem/cd_to_directory.feature} +0 -0
  80. data/features/{api/filesystem/does_exist.feature → 04_aruba_api/filesystem/check_existence_file_or_directory.feature} +0 -0
  81. data/features/{api/filesystem/is_absolute.feature → 04_aruba_api/filesystem/check_if_path_is_absolute.feature} +0 -0
  82. data/features/{api/filesystem/is_directory.feature → 04_aruba_api/filesystem/check_if_path_is_directory.feature} +0 -0
  83. data/features/{api/filesystem/is_file.feature → 04_aruba_api/filesystem/check_if_path_is_file.feature} +0 -0
  84. data/features/{api/filesystem/is_relative.feature → 04_aruba_api/filesystem/check_if_path_is_relative.feature} +0 -0
  85. data/features/{api → 04_aruba_api}/filesystem/create_directory.feature +0 -0
  86. data/features/{api/filesystem/move.feature → 04_aruba_api/filesystem/move_file_or_directory.feature} +0 -0
  87. data/features/{api/filesystem/disk_usage.feature → 04_aruba_api/filesystem/report_disk_usage.feature} +0 -0
  88. data/features/{api/filesystem/fixtures.feature → 04_aruba_api/filesystem/use_fixtures.feature} +0 -0
  89. data/features/{api → 04_aruba_api}/text/extract_text.feature +8 -8
  90. data/features/{api → 04_aruba_api}/text/replace_variables.feature +2 -2
  91. data/features/{api → 04_aruba_api}/text/sanitize_text.feature +22 -22
  92. data/features/{api → 04_aruba_api}/text/unescape_text.feature +12 -12
  93. data/features/{matchers/timeouts.feature → 05_use_rspec_matchers/command/check_timeouts.feature} +4 -4
  94. data/features/{matchers → 05_use_rspec_matchers}/directory/have_sub_directory.feature +0 -0
  95. data/features/{matchers → 05_use_rspec_matchers}/file/be_a_command_found_in_path.feature +0 -0
  96. data/features/{matchers → 05_use_rspec_matchers}/file/be_existing_executable.feature +0 -0
  97. data/features/{matchers → 05_use_rspec_matchers}/file/be_existing_file.feature +0 -0
  98. data/features/{matchers → 05_use_rspec_matchers}/file/have_file_content.feature +0 -0
  99. data/features/{matchers → 05_use_rspec_matchers}/file/have_file_size.feature +0 -0
  100. data/features/{matchers → 05_use_rspec_matchers}/path/be_an_absolute_path.feature +0 -0
  101. data/features/{matchers → 05_use_rspec_matchers}/path/be_an_existing_path.feature +0 -0
  102. data/features/{matchers → 05_use_rspec_matchers}/path/have_permissions.feature +4 -4
  103. data/features/{cli/init.feature → 06_use_aruba_cli/initialize_project_with_aruba.feature} +0 -0
  104. data/features/{cli/console.feature → 06_use_aruba_cli/open_console.feature} +0 -0
  105. data/features/08_other/improve_performance_if_using_jruby.feature +37 -0
  106. data/features/step_definitions/hooks.rb +0 -10
  107. data/features/support/env.rb +1 -1
  108. data/features/support/simplecov_setup.rb +9 -6
  109. data/fixtures/cli-app/bin/{cli → aruba-test-cli} +0 -0
  110. data/fixtures/cli-app/spec/spec_helper.rb +1 -0
  111. data/fixtures/empty-app/lib/cli/app.rb +0 -6
  112. data/lib/aruba/api/commands.rb +24 -0
  113. data/lib/aruba/api/core.rb +9 -2
  114. data/lib/aruba/api/deprecated.rb +2 -73
  115. data/lib/aruba/api/filesystem.rb +1 -1
  116. data/lib/aruba/colorizer.rb +10 -99
  117. data/lib/aruba/config/jruby.rb +15 -5
  118. data/lib/aruba/cucumber.rb +1 -0
  119. data/lib/aruba/cucumber/command.rb +63 -93
  120. data/lib/aruba/cucumber/deprecated.rb +93 -0
  121. data/lib/aruba/cucumber/file.rb +0 -12
  122. data/lib/aruba/cucumber/hooks.rb +0 -44
  123. data/lib/aruba/in_process.rb +2 -0
  124. data/lib/aruba/matchers/string/output_string_eq.rb +1 -1
  125. data/lib/aruba/platforms/announcer.rb +1 -1
  126. data/lib/aruba/platforms/command_monitor.rb +0 -3
  127. data/lib/aruba/processes/spawn_process.rb +17 -5
  128. data/lib/aruba/spawn_process.rb +4 -1
  129. data/lib/aruba/version.rb +1 -1
  130. data/script/bootstrap +0 -4
  131. data/spec/aruba/api/core_spec.rb +142 -0
  132. data/spec/aruba/api/deprecated_spec.rb +113 -0
  133. data/spec/aruba/api/filesystem_spec.rb +746 -0
  134. data/spec/aruba/api_spec.rb +1 -885
  135. data/spec/aruba/jruby_spec.rb +46 -28
  136. data/spec/aruba/{spawn_process_spec.rb → processes/spawn_process_spec.rb} +18 -2
  137. data/spec/spec_helper.rb +5 -3
  138. metadata +108 -115
  139. data/features/development/build.feature +0 -15
  140. data/features/getting_started/writing_good_feature_tests.feature +0 -38
  141. data/features/matchers/collection/include_an_object.feature +0 -72
  142. data/features/platforms/jruby.feature +0 -14
  143. data/features/step_definitions/aruba_dev_steps.rb +0 -56
  144. data/features/steps/command/shell.feature +0 -155
  145. data/features/steps/filesystem/check_file_content.feature +0 -61
  146. data/features/steps/filesystem/fixtures.feature +0 -64
  147. data/features/steps/overview.feature +0 -25
  148. data/spec/aruba/api/environment/restore_env_spec.rb +0 -86
  149. data/spec/aruba/api/environment/set_env_spec.rb +0 -46
  150. data/spec/aruba/api/filesystem/file_size_spec.rb +0 -28
@@ -29,7 +29,7 @@ Feature: STDERR of commands which were executed
29
29
  When I run `cucumber`
30
30
  Then the features should all pass
31
31
 
32
- Scenario: Detect stderr from all processes (deprecated)
32
+ Scenario: Detect stderr from all processes
33
33
  Given a file named "features/output.feature" with:
34
34
  """
35
35
  Feature: Run command
@@ -8,7 +8,7 @@ Feature: STDOUT of commands which were executed
8
8
  Given I use a fixture named "cli-app"
9
9
 
10
10
  Scenario: Match output in stdout
11
- Given an executable named "bin/cli" with:
11
+ Given an executable named "bin/aruba-test-cli" with:
12
12
  """bash
13
13
  #!/usr/bin/env bash
14
14
 
@@ -18,7 +18,7 @@ Feature: STDOUT of commands which were executed
18
18
  """cucumber
19
19
  Feature: Run command
20
20
  Scenario: Run command
21
- When I run `cli`
21
+ When I run `aruba-test-cli`
22
22
  Then the stdout should contain "hello"
23
23
  Then the stderr should not contain "hello"
24
24
  """
@@ -26,7 +26,7 @@ Feature: STDOUT of commands which were executed
26
26
  Then the features should all pass
27
27
 
28
28
  Scenario: Match stdout on several lines
29
- Given an executable named "bin/cli" with:
29
+ Given an executable named "bin/aruba-test-cli" with:
30
30
  """bash
31
31
  #!/usr/bin/env bash
32
32
 
@@ -36,7 +36,7 @@ Feature: STDOUT of commands which were executed
36
36
  """cucumber
37
37
  Feature: Run command
38
38
  Scenario: Run command
39
- When I run `cli`
39
+ When I run `aruba-test-cli`
40
40
  Then the stdout should contain:
41
41
  \"\"\"
42
42
  GET /
@@ -46,7 +46,7 @@ Feature: STDOUT of commands which were executed
46
46
  Then the features should all pass
47
47
 
48
48
  Scenario: Match output on several lines where stdout contains quotes
49
- Given an executable named "bin/cli" with:
49
+ Given an executable named "bin/aruba-test-cli" with:
50
50
  """bash
51
51
  #!/usr/bin/env bash
52
52
 
@@ -56,7 +56,7 @@ Feature: STDOUT of commands which were executed
56
56
  """cucumber
57
57
  Feature: Run command
58
58
  Scenario: Run command
59
- When I run `cli`
59
+ When I run `aruba-test-cli`
60
60
  Then the stdout should contain:
61
61
  \"\"\"
62
62
  GET "/"
@@ -9,7 +9,7 @@ Feature: Debug your command in cucumber-test-run
9
9
  And the default aruba exit timeout is 60 seconds
10
10
 
11
11
  Scenario: Can handle exit status 0
12
- Given an executable named "bin/cli" with:
12
+ Given an executable named "bin/aruba-test-cli" with:
13
13
  """bash
14
14
  #!/usr/bin/env bash
15
15
 
@@ -21,14 +21,14 @@ Feature: Debug your command in cucumber-test-run
21
21
 
22
22
  @debug
23
23
  Scenario: Run program with debug code
24
- When I run `cli`
24
+ When I run `aruba-test-cli`
25
25
  Then the exit status should be 0
26
26
  """
27
27
  When I successfully run `cucumber`
28
28
  Then the features should all pass
29
29
 
30
30
  Scenario: Can handle exit status 1
31
- Given an executable named "bin/cli" with:
31
+ Given an executable named "bin/aruba-test-cli" with:
32
32
  """bash
33
33
  #!/usr/bin/env bash
34
34
 
@@ -40,7 +40,7 @@ Feature: Debug your command in cucumber-test-run
40
40
 
41
41
  @debug
42
42
  Scenario: Run program with debug code
43
- When I run `cli`
43
+ When I run `aruba-test-cli`
44
44
  Then the exit status should be 1
45
45
  """
46
46
  When I successfully run `cucumber`
@@ -60,7 +60,7 @@ Feature: Debug your command in cucumber-test-run
60
60
  We are going to demonstrate this using `pry`, but any other interactive
61
61
  debugger for any other programming language should also work.
62
62
 
63
- Given an executable named "bin/cli" with:
63
+ Given an executable named "bin/aruba-test-cli" with:
64
64
  """ruby
65
65
  #!/usr/bin/env ruby
66
66
 
@@ -78,7 +78,7 @@ Feature: Debug your command in cucumber-test-run
78
78
 
79
79
  @debug
80
80
  Scenario: Run program with debug code
81
- When I run `cli`
81
+ When I run `aruba-test-cli`
82
82
  Then the exit status should be 0
83
83
  """
84
84
  When I run `cucumber` interactively
@@ -6,7 +6,7 @@ Feature: Run commands
6
6
  Given I use a fixture named "cli-app"
7
7
 
8
8
  Scenario: Run command found in path
9
- Given an executable named "bin/cli" with:
9
+ Given an executable named "bin/aruba-test-cli" with:
10
10
  """
11
11
  #!/bin/bash
12
12
  exit 0
@@ -15,13 +15,13 @@ Feature: Run commands
15
15
  """
16
16
  Feature: Run it
17
17
  Scenario: Run command
18
- When I run `cli`
18
+ When I run `aruba-test-cli`
19
19
  """
20
20
  When I run `cucumber`
21
21
  Then the features should all pass
22
22
 
23
23
  Scenario: Activate desired announcers when running command fails
24
- Given an executable named "bin/cli" with:
24
+ Given an executable named "bin/aruba-test-cli" with:
25
25
  """
26
26
  #!/bin/bash
27
27
  echo "Hello, I'm STDOUT"
@@ -31,7 +31,7 @@ Feature: Run commands
31
31
  """
32
32
  Feature: Run it
33
33
  Scenario: Run command
34
- When I successfully run `cli`
34
+ When I successfully run `aruba-test-cli`
35
35
  """
36
36
  And I append to "features/support/env.rb" with:
37
37
  """
@@ -103,7 +103,7 @@ Feature: Run commands in ruby process
103
103
  Then the features should all pass
104
104
 
105
105
  Scenario: Mixing custom code and normal cli
106
- Given an executable named "bin/cli" with:
106
+ Given an executable named "bin/aruba-test-cli" with:
107
107
  """
108
108
  #!/bin/bash
109
109
  echo $*
@@ -140,7 +140,7 @@ Feature: Run commands in ruby process
140
140
  \"\"\"
141
141
 
142
142
  Scenario: Run command
143
- When I run `cli Hello World`
143
+ When I run `aruba-test-cli Hello World`
144
144
  Then the output should contain:
145
145
  \"\"\"
146
146
  Hello World
@@ -9,7 +9,7 @@ Feature: Running an interactive command
9
9
 
10
10
  @wip-jruby-java-1.6
11
11
  Scenario: Running ruby interactively
12
- Given an executable named "bin/cli" with:
12
+ Given an executable named "bin/aruba-test-cli" with:
13
13
  """bash
14
14
  #!/usr/bin/env ruby
15
15
 
@@ -22,7 +22,7 @@ Feature: Running an interactive command
22
22
  """cucumber
23
23
  Feature: Run command
24
24
  Scenario: Run command
25
- When I run `cli` interactively
25
+ When I run `aruba-test-cli` interactively
26
26
  And I type "hello, world"
27
27
  And I type "quit"
28
28
  Then it should pass with "dlrow ,olleh"
@@ -0,0 +1,79 @@
1
+ Feature: Running shell commands
2
+
3
+ You can run an *ad hoc* script with the following steps:
4
+ - `When I run the following script:`
5
+
6
+ Or you can run shell commands with:
7
+ - `I run the following commands`
8
+ - `I run the following commands (in|with) \`interpreter\``
9
+ - `I run the following commands (in|with) \`/path/to/interpreter\``
10
+
11
+ Background:
12
+ Given I use a fixture named "cli-app"
13
+
14
+ Scenario: Creating and running scripts
15
+ Given a file named "features/shell.feature" with:
16
+ """
17
+ Feature: Running scripts
18
+ Scenario: Running ruby script
19
+ When I run the following script:
20
+ \"\"\"bash
21
+ #!/usr/bin/env ruby
22
+
23
+ puts "Hello"
24
+ \"\"\"
25
+ Then the output should contain "Hello"
26
+
27
+ Scenario: Running python script
28
+ When I run the following script:
29
+ \"\"\"bash
30
+ #!/usr/bin/env python
31
+
32
+ print("Hello")
33
+ \"\"\"
34
+ Then the output should contain exactly "Hello"
35
+ """
36
+ When I run `cucumber`
37
+ Then the features should all pass
38
+
39
+ Scenario: Running shell commands
40
+ Given a file named "features/shell.feature" with:
41
+ """
42
+ Feature: Running scripts
43
+ Scenario: Running shell commands
44
+ When I run the following commands:
45
+ \"\"\"bash
46
+ echo "Hello shell"
47
+ \"\"\"
48
+ Then the output should contain exactly "Hello shell"
49
+ """
50
+ When I run `cucumber`
51
+ Then the features should all pass
52
+
53
+ Scenario: Running commands with a named interpreter
54
+ Given a file named "features/shell.feature" with:
55
+ """
56
+ Feature: Running scripts
57
+ Scenario: Running ruby commands
58
+ When I run the following commands with `ruby`:
59
+ \"\"\"
60
+ puts "Hello, Aruba!"
61
+ \"\"\"
62
+ Then the output should contain "Hello, Aruba!"
63
+ """
64
+ When I run `cucumber`
65
+ Then the features should all pass
66
+
67
+ Scenario: Running commands if full path to interpreter is given
68
+ Given a file named "features/shell.feature" with:
69
+ """
70
+ Feature: Running full path
71
+ Scenario: Running full path bash
72
+ When I run the following commands with `/bin/bash`:
73
+ \"\"\"bash
74
+ echo "Hello Aruba!"
75
+ \"\"\"
76
+ Then the output should contain "Hello Aruba!"
77
+ """
78
+ When I run `cucumber`
79
+ Then the features should all pass
@@ -3,15 +3,13 @@ Feature: Send a signal to command
3
3
  You can send a command a signal with the following steps:
4
4
 
5
5
  - `When I send the signal "HUP" to the command started last`
6
- - `When I send the signal "HUP" to the command "bin/cli"`
6
+ - `When I send the signal "HUP" to the command "bin/aruba-test-cli"`
7
7
 
8
8
  Or just use `kill` on compatible platforms.
9
9
 
10
10
  Background:
11
11
  Given I use a fixture named "cli-app"
12
-
13
- Scenario: Sending signal to the command started last
14
- Given an executable named "bin/cli" with:
12
+ And an executable named "bin/aruba-test-cli" with:
15
13
  """bash
16
14
  #!/usr/bin/env bash
17
15
  function hup {
@@ -20,15 +18,22 @@ Feature: Send a signal to command
20
18
  }
21
19
 
22
20
  trap hup HUP
23
- while [ true ]; do sleep 1; done
21
+ while [ true ]; do sleep 0.1; done
22
+ """
23
+ And a file named "features/support/aruba_config.rb" with:
24
+ """ruby
25
+ Aruba.configure do |config|
26
+ config.startup_wait_time = 0.1
27
+ config.exit_timeout = 0.2
28
+ end
24
29
  """
25
- And a file named "features/run.feature" with:
30
+
31
+ Scenario: Sending signal to the command started last
32
+ Given a file named "features/run.feature" with:
26
33
  """
27
34
  Feature: Run it
28
35
  Scenario: Run command
29
- Given the default aruba exit timeout is 5 seconds
30
- And I wait 5 seconds for a command to start up
31
- When I run `cli` in background
36
+ When I run `aruba-test-cli` in background
32
37
  And I send the signal "HUP" to the command started last
33
38
  Then the exit status should be 0
34
39
  And the output should contain:
@@ -40,25 +45,12 @@ Feature: Send a signal to command
40
45
  Then the features should all pass
41
46
 
42
47
  Scenario: Sending signal to a command given by command line
43
- Given an executable named "bin/cli" with:
44
- """bash
45
- #!/usr/bin/env bash
46
- function hup {
47
- echo "Got signal HUP."
48
- exit 0
49
- }
50
-
51
- trap hup HUP
52
- while [ true ]; do sleep 1; done
53
- """
54
- And a file named "features/run.feature" with:
48
+ Given a file named "features/run.feature" with:
55
49
  """
56
50
  Feature: Run it
57
51
  Scenario: Run command
58
- Given the default aruba exit timeout is 5 seconds
59
- And I wait 5 seconds for a command to start up
60
- When I run `cli` in background
61
- And I send the signal "HUP" to the command "cli"
52
+ When I run `aruba-test-cli` in background
53
+ And I send the signal "HUP" to the command "aruba-test-cli"
62
54
  Then the exit status should be 0
63
55
  And the output should contain:
64
56
  \"\"\"
@@ -76,24 +68,11 @@ Feature: Send a signal to command
76
68
  PID of the last command started. Please note, this feature is experimental.
77
69
  The name of the variable may change without further notice.
78
70
 
79
- Given an executable named "bin/cli" with:
80
- """bash
81
- #!/usr/bin/env bash
82
- function hup {
83
- echo "Got signal HUP."
84
- exit 0
85
- }
86
-
87
- trap hup HUP
88
- while [ true ]; do sleep 1; done
89
- """
90
- And a file named "features/run.feature" with:
71
+ Given a file named "features/run.feature" with:
91
72
  """
92
73
  Feature: Run it
93
74
  Scenario: Run command
94
- Given the default aruba exit timeout is 5 seconds
95
- And I wait 5 seconds for a command to start up
96
- When I run `cli` in background
75
+ When I run `aruba-test-cli` in background
97
76
  And I run `kill -HUP <pid-last-command-started>`
98
77
  Then the output should contain:
99
78
  \"\"\"
@@ -15,7 +15,7 @@ Feature: Stop commands
15
15
 
16
16
  Terminating a command will send `SIGTERM` to the command.
17
17
 
18
- Given an executable named "bin/cli1" with:
18
+ Given an executable named "bin/aruba-test-cli1" with:
19
19
  """bash
20
20
  #!/bin/bash
21
21
 
@@ -25,10 +25,10 @@ Feature: Stop commands
25
25
 
26
26
  trap term TERM
27
27
  echo "Hello, Aruba!"
28
- while [ true ]; do sleep 1; done
28
+ while [ true ]; do sleep 0.1; done
29
29
  exit 1
30
30
  """
31
- And an executable named "bin/cli2" with:
31
+ And an executable named "bin/aruba-test-cli2" with:
32
32
  """bash
33
33
  #!/bin/bash
34
34
 
@@ -38,17 +38,17 @@ Feature: Stop commands
38
38
 
39
39
  trap term TERM
40
40
  echo "Hello, Aruba!"
41
- while [ true ]; do sleep 1; done
41
+ while [ true ]; do sleep 0.1; done
42
42
  exit 1
43
43
  """
44
44
  And a file named "features/stop.feature" with:
45
45
  """
46
46
  Feature: Run it
47
47
  Scenario: Run command
48
- Given the default aruba exit timeout is 1 second
49
- And I wait 2 seconds for a command to start up
50
- When I run `cli1` in background
51
- And I run `cli2` in background
48
+ Given the default aruba exit timeout is 0.2 seconds
49
+ And I wait 0.1 seconds for a command to start up
50
+ When I run `aruba-test-cli1` in background
51
+ And I run `aruba-test-cli2` in background
52
52
  And I terminate the command started last
53
53
  Then the exit status should be 155
54
54
  And the output should contain:
@@ -65,7 +65,7 @@ Feature: Stop commands
65
65
  send `SIGTERM` to the command. Normally "n" is defined by the default exit
66
66
  timeout of aruba.
67
67
 
68
- Given an executable named "bin/cli1" with:
68
+ Given an executable named "bin/aruba-test-cli1" with:
69
69
  """bash
70
70
  #!/bin/bash
71
71
 
@@ -75,10 +75,10 @@ Feature: Stop commands
75
75
 
76
76
  trap term TERM
77
77
  echo "Hello, Aruba!"
78
- while [ true ]; do sleep 1; done
78
+ while [ true ]; do sleep 0.1; done
79
79
  exit 1
80
80
  """
81
- And an executable named "bin/cli2" with:
81
+ And an executable named "bin/aruba-test-cli2" with:
82
82
  """bash
83
83
  #!/bin/bash
84
84
 
@@ -88,7 +88,7 @@ Feature: Stop commands
88
88
 
89
89
  trap term TERM
90
90
  echo "Hello, Aruba!"
91
- while [ true ]; do sleep 1; done
91
+ while [ true ]; do sleep 0.1; done
92
92
  exit 1
93
93
  """
94
94
  And a file named "features/stop.feature" with:
@@ -97,10 +97,10 @@ Feature: Stop commands
97
97
  Background:
98
98
 
99
99
  Scenario: Run command
100
- Given the default aruba exit timeout is 5 seconds
101
- And I wait 2 seconds for a command to start up
102
- When I run `cli1` in background
103
- And I run `cli2` in background
100
+ Given the default aruba exit timeout is 0.2 seconds
101
+ And I wait 0.1 seconds for a command to start up
102
+ When I run `aruba-test-cli1` in background
103
+ And I run `aruba-test-cli2` in background
104
104
  And I stop the command started last
105
105
  Then the exit status should be 155
106
106
  And the output should contain:
@@ -116,7 +116,7 @@ Feature: Stop commands
116
116
  Pass the commandline to the step to find the command, which should be
117
117
  stopped.
118
118
 
119
- Given an executable named "bin/cli1" with:
119
+ Given an executable named "bin/aruba-test-cli1" with:
120
120
  """bash
121
121
  #!/bin/bash
122
122
 
@@ -126,9 +126,9 @@ Feature: Stop commands
126
126
 
127
127
  trap term TERM
128
128
  echo "Hello, Aruba!"
129
- while [ true ]; do sleep 1; done
129
+ while [ true ]; do sleep 0.1; done
130
130
  """
131
- And an executable named "bin/cli2" with:
131
+ And an executable named "bin/aruba-test-cli2" with:
132
132
  """bash
133
133
  #!/bin/bash
134
134
 
@@ -138,20 +138,20 @@ Feature: Stop commands
138
138
 
139
139
  trap term TERM
140
140
  echo "Hello, Aruba!"
141
- while [ true ]; do sleep 1; done
141
+ while [ true ]; do sleep 0.1; done
142
142
  exit 2
143
143
  """
144
144
  And a file named "features/stop.feature" with:
145
145
  """
146
146
  Feature: Run it
147
147
  Background:
148
- Given the default aruba exit timeout is 5 seconds
148
+ Given the default aruba exit timeout is 0.2 seconds
149
149
 
150
150
  Scenario: Run command
151
- Given I wait 2 seconds for a command to start up
152
- When I run `cli1` in background
153
- When I run `cli2` in background
154
- And I terminate the command "cli1"
151
+ Given I wait 0.1 seconds for a command to start up
152
+ When I run `aruba-test-cli1` in background
153
+ When I run `aruba-test-cli2` in background
154
+ And I terminate the command "aruba-test-cli1"
155
155
  Then the exit status should be 100
156
156
  And the output should contain:
157
157
  \"\"\"
@@ -167,7 +167,7 @@ Feature: Stop commands
167
167
  send `SIGTERM` to the command. Normally "n" is defined by the default exit
168
168
  timeout of aruba.
169
169
 
170
- Given an executable named "bin/cli1" with:
170
+ Given an executable named "bin/aruba-test-cli1" with:
171
171
  """bash
172
172
  #!/bin/bash
173
173
 
@@ -177,10 +177,10 @@ Feature: Stop commands
177
177
 
178
178
  trap term TERM
179
179
  echo "Hello, Aruba!"
180
- while [ true ]; do sleep 1; done
180
+ while [ true ]; do sleep 0.1; done
181
181
  exit 1
182
182
  """
183
- And an executable named "bin/cli2" with:
183
+ And an executable named "bin/aruba-test-cli2" with:
184
184
  """bash
185
185
  #!/bin/bash
186
186
 
@@ -190,20 +190,20 @@ Feature: Stop commands
190
190
 
191
191
  trap term TERM
192
192
  echo "Hello, Aruba!"
193
- while [ true ]; do sleep 1; done
193
+ while [ true ]; do sleep 0.1; done
194
194
  exit 1
195
195
  """
196
196
  And a file named "features/stop.feature" with:
197
197
  """
198
198
  Feature: Run it
199
199
  Background:
200
- Given the default aruba exit timeout is 5 seconds
200
+ Given the default aruba exit timeout is 0.2 seconds
201
201
 
202
202
  Scenario: Run command
203
- Given I wait 2 seconds for a command to start up
204
- When I run `cli1` in background
205
- And I run `cli2` in background
206
- When I stop the command "cli1"
203
+ Given I wait 0.1 seconds for a command to start up
204
+ When I run `aruba-test-cli1` in background
205
+ And I run `aruba-test-cli2` in background
206
+ When I stop the command "aruba-test-cli1"
207
207
  Then the exit status should be 155
208
208
  And the output should contain:
209
209
  \"\"\"
@@ -217,7 +217,7 @@ Feature: Stop commands
217
217
 
218
218
  You can define a default signal which is used to stop all commands.
219
219
 
220
- Given an executable named "bin/cli" with:
220
+ Given an executable named "bin/aruba-test-cli" with:
221
221
  """bash
222
222
  #!/bin/bash
223
223
  function hup {
@@ -231,7 +231,7 @@ Feature: Stop commands
231
231
  trap hup HUP
232
232
  trap term TERM
233
233
  echo "Hello, Aruba!"
234
- while [ true ]; do sleep 1; done
234
+ while [ true ]; do sleep 0.1; done
235
235
  exit 1
236
236
  """
237
237
  And a file named "features/run.feature" with:
@@ -239,49 +239,21 @@ Feature: Stop commands
239
239
  Feature: Run it
240
240
  Scenario: Run command
241
241
  Given the default aruba stop signal is "HUP"
242
- And the default aruba exit timeout is 5 seconds
243
- When I run `cli`
242
+ And the default aruba exit timeout is 0.2 seconds
243
+ When I run `aruba-test-cli`
244
244
  Then the exit status should be 155
245
245
  """
246
246
  When I run `cucumber`
247
247
  Then the features should all pass
248
248
 
249
- @requires-ruby-platform-java
250
- Scenario: STDERR/STDOUT is empty on JRUBY if output was written in "signal"-handler
251
- Given an executable named "bin/cli1" with:
252
- """bash
253
- #!/bin/bash
249
+ @requires-ruby-platform-mri
250
+ Scenario: STDERR/STDOUT is captured from signal handlers
254
251
 
255
- function term {
256
- echo 'Hello, TERM'
257
- exit 100
258
- }
252
+ STDERR/STDOUT is written normally on MRI if output was written in "signal"-handler
259
253
 
260
- trap term TERM
261
- echo "Hello, Aruba!"
262
- while [ true ]; do sleep 1; done
263
- exit 1
264
- """
265
- And a file named "features/stop.feature" with:
266
- """
267
- Feature: Run it
268
- Scenario: Run command
269
- Given the default aruba exit timeout is 1 second
270
- And I wait 2 seconds for a command to start up
271
- When I run `cli1` in background
272
- And I terminate the command started last
273
- Then the exit status should be 100
274
- And the output should not contain:
275
- \"\"\"
276
- Hello, TERM
277
- \"\"\"
278
- """
279
- When I run `cucumber`
280
- Then the features should all pass
254
+ This is currently broken on JRuby.
281
255
 
282
- @requires-ruby-platform-mri
283
- Scenario: STDERR/STDOUT is written normally with MRI-Ruby if output was written in "signal"-handler
284
- Given an executable named "bin/cli1" with:
256
+ Given an executable named "bin/aruba-test-cli1" with:
285
257
  """bash
286
258
  #!/bin/bash
287
259
 
@@ -292,16 +264,16 @@ Feature: Stop commands
292
264
 
293
265
  trap term TERM
294
266
  echo "Hello, Aruba!"
295
- while [ true ]; do sleep 1; done
267
+ while [ true ]; do sleep 0.1; done
296
268
  exit 1
297
269
  """
298
270
  And a file named "features/stop.feature" with:
299
271
  """
300
272
  Feature: Run it
301
273
  Scenario: Run command
302
- Given the default aruba exit timeout is 1 second
303
- And I wait 2 seconds for a command to start up
304
- When I run `cli1` in background
274
+ Given the default aruba exit timeout is 0.2 seconds
275
+ And I wait 0.1 seconds for a command to start up
276
+ When I run `aruba-test-cli1` in background
305
277
  And I terminate the command started last
306
278
  Then the exit status should be 100
307
279
  And the output should contain: