aruba 0.9.0.pre → 0.9.0.pre2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (158) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +8 -3
  3. data/History.md +61 -19
  4. data/README.md +10 -6
  5. data/TODO.md +6 -1
  6. data/cucumber.yml +10 -6
  7. data/features/.nav +72 -0
  8. data/features/announce.feature +203 -0
  9. data/features/api/command/extract_text.feature +10 -0
  10. data/features/api/command/run.feature +6 -6
  11. data/features/api/command/stop_all_commands.feature +53 -0
  12. data/features/api/command/terminate_all_commands.feature +53 -0
  13. data/features/api/command/unescape_text.feature +12 -0
  14. data/features/api/command/which.feature +3 -3
  15. data/features/api/core/expand_path.feature +4 -4
  16. data/features/api/environment/append_environment_variable.feature +18 -8
  17. data/features/api/environment/prepend_environment_variable.feature +18 -8
  18. data/features/api/environment/set_environment_variable.feature +33 -16
  19. data/features/api/filesystem/cd.feature +23 -13
  20. data/features/api/filesystem/create_directory.feature +2 -2
  21. data/features/api/filesystem/disk_usage.feature +7 -6
  22. data/features/api/filesystem/does_exist.feature +2 -2
  23. data/features/api/filesystem/is_absolute.feature +2 -2
  24. data/features/api/filesystem/is_directory.feature +2 -2
  25. data/features/api/filesystem/is_file.feature +2 -2
  26. data/features/api/filesystem/is_relative.feature +2 -2
  27. data/features/api/filesystem/move.feature +119 -0
  28. data/features/cli/console.feature +3 -3
  29. data/features/commands/debug_command.feature +93 -0
  30. data/features/commands/environment_variables.feature +64 -0
  31. data/features/commands/flushing.feature +74 -0
  32. data/features/commands/interactive.feature +90 -0
  33. data/features/commands/output/all_output.feature +445 -0
  34. data/features/commands/output/stdout.feature +66 -0
  35. data/features/configuration/exit_timeout.feature +5 -5
  36. data/features/configuration/fixtures_directories.feature +3 -3
  37. data/features/configuration/fixtures_path_prefix.feature +1 -1
  38. data/features/configuration/home_directory.feature +4 -4
  39. data/features/configuration/io_timeout.feature +2 -2
  40. data/features/configuration/keep_ansi.feature +2 -2
  41. data/features/configuration/log_level.feature +3 -3
  42. data/features/configuration/physical_block_size.feature +3 -3
  43. data/features/configuration/usage.feature +159 -0
  44. data/features/core/cleanup_aruba_directory.feature +52 -0
  45. data/features/development/build.feature +16 -0
  46. data/features/development/test.feature +24 -0
  47. data/features/file_system_commands.feature +12 -12
  48. data/features/getting_started/supported_programming_languages.feature +89 -0
  49. data/features/hooks/after/command.feature +1 -1
  50. data/features/hooks/before/command.feature +2 -2
  51. data/features/matchers/collection/include_an_object.feature +72 -0
  52. data/features/matchers/timeouts.feature +2 -2
  53. data/features/output.feature +60 -181
  54. data/features/step_definitions/aruba_dev_steps.rb +17 -10
  55. data/features/step_definitions/hooks.rb +11 -0
  56. data/features/steps/commands/exit_statuses.feature +3 -3
  57. data/features/steps/commands/run.feature +0 -15
  58. data/features/steps/filesystem/copy.feature +45 -0
  59. data/features/steps/filesystem/create_directory.feature +47 -0
  60. data/features/steps/filesystem/create_file.feature +53 -0
  61. data/features/steps/filesystem/file_content.feature +1 -1
  62. data/features/steps/filesystem/move.feature +45 -0
  63. data/features/steps/filesystem/overwrite_file.feature +72 -0
  64. data/features/steps/filesystem/use_fixture.feature +77 -0
  65. data/features/usage/install.feature +8 -0
  66. data/{features/fixtures → fixtures}/cli-app/.gitignore +0 -0
  67. data/{features/fixtures → fixtures}/cli-app/.rspec +0 -0
  68. data/{features/fixtures → fixtures}/cli-app/README.md +0 -0
  69. data/{features/fixtures → fixtures}/cli-app/Rakefile +0 -0
  70. data/{features/fixtures → fixtures}/cli-app/bin/cli +0 -0
  71. data/{features/fixtures → fixtures}/cli-app/cli-app.gemspec +0 -0
  72. data/{features/fixtures → fixtures}/cli-app/features/support/env.rb +0 -0
  73. data/{features/fixtures → fixtures}/cli-app/lib/cli/app.rb +0 -0
  74. data/fixtures/cli-app/lib/cli/app/suppress_simple_cov_output.rb +15 -0
  75. data/{features/fixtures → fixtures}/cli-app/lib/cli/app/version.rb +0 -0
  76. data/{features/fixtures/empty-app → fixtures/cli-app}/script/console +3 -3
  77. data/{features/fixtures → fixtures}/cli-app/spec/spec_helper.rb +0 -0
  78. data/{features/fixtures → fixtures}/cli-app/spec/support/aruba.rb +0 -0
  79. data/{features/fixtures → fixtures}/copy/file.txt +0 -0
  80. data/{features/fixtures → fixtures}/empty-app/.gitignore +0 -0
  81. data/{features/fixtures → fixtures}/empty-app/.rspec +0 -0
  82. data/{features/fixtures → fixtures}/empty-app/README.md +0 -0
  83. data/{features/fixtures → fixtures}/empty-app/Rakefile +0 -0
  84. data/{features/fixtures → fixtures}/empty-app/bin/cli +0 -0
  85. data/{features/fixtures → fixtures}/empty-app/cli-app.gemspec +0 -0
  86. data/{features/fixtures → fixtures}/empty-app/lib/cli/app.rb +0 -0
  87. data/{features/fixtures → fixtures}/empty-app/lib/cli/app/version.rb +0 -0
  88. data/{features/fixtures/cli-app → fixtures/empty-app}/script/console +3 -3
  89. data/{features/fixtures → fixtures}/empty-app/spec/spec_helper.rb +0 -0
  90. data/{features/fixtures → fixtures}/fixtures-app/test.txt +0 -0
  91. data/fixtures/getting-started-app/.gitignore +4 -0
  92. data/fixtures/getting-started-app/Gemfile +4 -0
  93. data/fixtures/getting-started-app/README.md +3 -0
  94. data/fixtures/getting-started-app/features/support/env.rb +1 -0
  95. data/{features/fixtures → fixtures}/spawn_process/stderr.sh +0 -0
  96. data/lib/aruba/announcer.rb +6 -2
  97. data/lib/aruba/api.rb +0 -16
  98. data/lib/aruba/api/command.rb +64 -266
  99. data/lib/aruba/api/core.rb +24 -26
  100. data/lib/aruba/api/deprecated.rb +370 -12
  101. data/lib/aruba/api/filesystem.rb +64 -15
  102. data/lib/aruba/aruba_path.rb +4 -0
  103. data/lib/aruba/config.rb +1 -1
  104. data/lib/aruba/cucumber.rb +5 -449
  105. data/lib/aruba/cucumber/command.rb +378 -0
  106. data/lib/aruba/cucumber/core.rb +29 -0
  107. data/lib/aruba/cucumber/environment.rb +30 -0
  108. data/lib/aruba/cucumber/file.rb +210 -0
  109. data/lib/aruba/cucumber/hooks.rb +11 -14
  110. data/lib/aruba/cucumber/rvm.rb +3 -0
  111. data/lib/aruba/matchers/base/base_matcher.rb +94 -0
  112. data/lib/aruba/matchers/collection.rb +1 -0
  113. data/lib/aruba/matchers/collection/all_objects.rb +2 -0
  114. data/lib/aruba/matchers/collection/include_an_object.rb +120 -0
  115. data/lib/aruba/matchers/command/be_successfully_executed.rb +3 -3
  116. data/lib/aruba/matchers/command/have_exit_status.rb +2 -11
  117. data/lib/aruba/matchers/command/have_finished_in_time.rb +5 -5
  118. data/lib/aruba/matchers/command/have_output.rb +46 -0
  119. data/lib/aruba/matchers/command/have_output_on_stderr.rb +42 -0
  120. data/lib/aruba/matchers/command/have_output_on_stdout.rb +42 -0
  121. data/lib/aruba/matchers/command/have_output_size.rb +28 -0
  122. data/lib/aruba/matchers/directory/be_an_existing_directory.rb +1 -1
  123. data/lib/aruba/matchers/file/be_an_existing_file.rb +1 -1
  124. data/lib/aruba/matchers/file/have_file_content.rb +1 -1
  125. data/lib/aruba/matchers/file/have_file_size.rb +2 -2
  126. data/lib/aruba/matchers/file/have_same_file_content.rb +1 -1
  127. data/lib/aruba/matchers/path/have_permissions.rb +1 -1
  128. data/lib/aruba/platforms/aruba_file_creator.rb +2 -3
  129. data/lib/aruba/platforms/aruba_fixed_size_file_creator.rb +2 -3
  130. data/lib/aruba/platforms/determine_disk_usage.rb +23 -0
  131. data/lib/aruba/platforms/determine_file_size.rb +13 -0
  132. data/lib/aruba/platforms/disk_usage_calculator.rb +11 -0
  133. data/lib/aruba/platforms/local_environment.rb +15 -0
  134. data/lib/aruba/platforms/unix_environment_variables.rb +1 -1
  135. data/lib/aruba/platforms/unix_platform.rb +35 -14
  136. data/lib/aruba/process_monitor.rb +53 -7
  137. data/lib/aruba/processes/basic_process.rb +25 -5
  138. data/lib/aruba/processes/debug_process.rb +27 -25
  139. data/lib/aruba/processes/in_process.rb +7 -22
  140. data/lib/aruba/processes/spawn_process.rb +74 -31
  141. data/lib/aruba/rspec.rb +1 -6
  142. data/lib/aruba/version.rb +1 -1
  143. data/script/console +0 -1
  144. data/spec/aruba/api/environment/restore_env_spec.rb +65 -0
  145. data/spec/aruba/api/environment/set_env_spec.rb +42 -0
  146. data/spec/aruba/api/filesystem/file_size_spec.rb +28 -0
  147. data/spec/aruba/api_spec.rb +10 -7
  148. data/spec/aruba/matchers/command/have_output_size_spec.rb +25 -0
  149. data/spec/aruba/matchers/command_spec.rb +135 -4
  150. data/spec/aruba/spawn_process_spec.rb +1 -1
  151. metadata +107 -65
  152. data/.nav +0 -12
  153. data/features/debug.feature +0 -15
  154. data/features/fixtures/cli-app/spec/cli/app_spec.rb +0 -7
  155. data/features/flushing.feature +0 -26
  156. data/features/interactive.feature +0 -66
  157. data/features/no_clobber.feature +0 -25
  158. data/lib/aruba/disk_usage_calculator.rb +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 71f21475524ff2255d0cba069a187f55eab76a63
4
- data.tar.gz: 6b76f7d95d15526e86d3ef939cb317a98dabc5ac
3
+ metadata.gz: f92ba90eaed6ac6f97ad8b43f5913fde2fb0f3a1
4
+ data.tar.gz: 1ab9079d180953f236b8529749303059a142cc85
5
5
  SHA512:
6
- metadata.gz: 03123d44f1928b357d180dfe202d35b2c9e3c6f33a613ee8a60c52744d2a5fd6170e184f76abf826745ca0c98aefab602eafa9fdbf63fa274db88e862013eee1
7
- data.tar.gz: dbc946f90ee79b79fde4acfa617010bcffc9d7813ad83bf2b966cb1a4f1d6e14ca317e137e14a26a77ad7edc9a4af52c0a25bbfb2cce557cdf2dea1e1bc859c3
6
+ metadata.gz: 8ab6deff05d7a0366724279a055ce42296b7549b50cf8acd71b655823ad471d19ff3313001e1913da4ea2246f9bf06ff58284d1460dd5b535b947f457536c674
7
+ data.tar.gz: f234b29f5ae59ebc4ed1cc9939d4d358d3bd4d0ac3212c1a56f0151b4bc4743fe4cd623750e044dfba2417e46a79b1124c1b06e05a301a10ceda89989d000849
data/Gemfile CHANGED
@@ -5,14 +5,12 @@ gemspec
5
5
 
6
6
  # Debug aruba
7
7
  group :debug do
8
- gem 'pry', '~> 0.10.1'
9
-
10
8
  if RUBY_VERSION >= '2' && !RUBY_PLATFORM.include?('java')
11
9
  gem 'byebug', '~> 4.0.5'
12
10
  gem 'pry-byebug', '~> 3.1.0'
13
11
  end
14
12
 
15
- if RUBY_VERSION < '2' && !RUBY_PLATFORM.include?('java')
13
+ if RUBY_VERSION < '2' && RUBY_VERSION > '1.9' && !RUBY_PLATFORM.include?('java')
16
14
  gem 'debugger', '~> 1.6.8'
17
15
  gem 'pry-debugger', '~> 0.2.3'
18
16
  end
@@ -25,6 +23,13 @@ group :debug do
25
23
  end
26
24
 
27
25
  group :development, :test do
26
+ # we use this to demonstrate interactive debugging within our feature tests
27
+ if RUBY_VERSION >= '2'
28
+ gem 'pry', '~> 0.10.1'
29
+ else
30
+ gem 'pry', '~>0.9.12'
31
+ end
32
+
28
33
  # Run development tasks
29
34
  gem 'rake', '~> 10.4.2'
30
35
 
data/History.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Latest Release
2
2
 
3
+ ## [v0.9.0.pre](https://github.com/cucumber/aruba/compare/v0.8.1...v0.9.0.pre)
4
+
5
+ * Improve documentation for filesystem api and move it to feature tests
6
+ * Add logger to aruba. Its output can be captured by rspec.
7
+ * Fix incorrect deprecation message for check_file_presence (issue #292)
8
+ * Fix for Gemfile excludes windows for many gems (issue #282)
9
+ * Make feature tests compatible with ruby 1.9.2
10
+ * Gather disk usage for file(s) (issue #294)
11
+ * Replace keep_ansi-config option by remove_ansi_escape_sequences-option
12
+ * Split up `#unescape` into `#extract_text` and `#unescape_text`
13
+ * Use `UnixPlatform` and `WindowsPlatform` to make code for different platforms maintainable
14
+ * Work around `ENV`-bug in `Jruby` buy using `#dup` on `ENV.to_h` (issue jruby/jruby#3162)
15
+ * Speed up test on `JRuby` by using `--dev`-flag
16
+ * Work around problems when copying files with `cp` on MRI-ruby 1.9.2
17
+ * Add cmd.exe /c for SpawnProcess on Windows (issue #302)
18
+ * Split up `#which` for Windows and Unix/Linux (issue #304)
19
+ * Add `aruba console`-command to play around with aruba (issue 305)
20
+
21
+ # Old releases
22
+
3
23
  ## [v0.8.1](https://github.com/cucumber/aruba/compare/v0.8.0...v0.8.1)
4
24
 
5
25
  * Fix problem if working directory of aruba does not exist (issue #286)
@@ -11,8 +31,6 @@
11
31
  * Use prepend_environment_variable to modify PATH for rspec integration
12
32
  * Add VERSION-constant to aruba and use it for code which should be activated on >= 1.0.0
13
33
 
14
- # Old releases
15
-
16
34
  ## [v0.8.0](https://github.com/cucumber/aruba/compare/v0.8.0.pre3...v0.8.0)
17
35
  * Build with cucumber 1.3.x on ruby 1.8.7, with cucumber 2.x on all other platforms
18
36
  * Fixed bugs in aruba's cucumber steps
@@ -350,23 +368,25 @@
350
368
 
351
369
  # Upcoming un-released versions
352
370
 
353
- ## [v0.9.0](https://github.com/cucumber/aruba/compare/v0.8.1...v0.9.0)
354
-
355
- * Improve documentation for filesystem api and move it to feature tests
356
- * Add logger to aruba. Its output can be captured by rspec.
357
- * Fix incorrect deprecation message for check_file_presence (issue #292)
358
- * Fix for Gemfile excludes windows for many gems (issue #282)
359
- * Make feature tests compatible with ruby 1.9.2
360
- * Gather disk usage for file(s) (issue #294)
361
- * Replace keep_ansi-config option by remove_ansi_escape_sequences-option
362
- * Split up `#unescape` into `#extract_text` and `#unescape_text`
363
- * Use `UnixPlatform` and `WindowsPlatform` to make code for different platforms maintainable
364
- * Work around `ENV`-bug in `Jruby` buy using `#dup` on `ENV.to_h` (issue jruby/jruby#3162)
365
- * Speed up test on `JRuby` by using `--dev`-flag
366
- * Work around problems when copying files with `cp` on MRI-ruby 1.9.2
367
- * Add cmd.exe /c for SpawnProcess on Windows (issue #302)
368
- * Split up `#which` for Windows and Unix/Linux (issue #304)
369
- * Add `aruba console`-command to play around with aruba (issue 305)
371
+ ## [v0.9.0.pre2](https://github.com/cucumber/aruba/compare/v0.9.0.pre...v0.9.0.pre2)
372
+
373
+ * Redefine #to_s and #inspect for BasicProcess to reduce the sheer amount of
374
+ information, if a command produces a lot of output
375
+ * Added new matcher `#all_objects` to check if an object is included + a error message for
376
+ failures which is similar to the `#all`-matcher of `RSpec`
377
+ * Add `have_output`-, `have_output_on_stderr`, `have_output_on_stdout`-matchers
378
+ * Replace all `assert_*` and `check_*`-methods through expectations
379
+ * Add hook `@announce-output` to output both, stderr and stdout
380
+ * Add a lot of documentation (issue #260)
381
+ * Replace `#last_command` through `#last_command_started` and
382
+ `#last_command_stopped` to make it more explicit
383
+ * Improve syntax highlighting in cucumber feature tests by adding programming
384
+ language to `"""`-blocks
385
+ * Rename tags `@ignore-*` to `@unsupported-on-*`
386
+ * Introduce our own `BaseMatcher`-class to remove the dependency to `RSpec`'s
387
+ private matcher APIs
388
+ * Now we make the process started via `SpawnProcess` the leader of the group to
389
+ kill all sub-processes more reliably
370
390
 
371
391
  ## [v1.0.0](https://github.com/cucumber/aruba/compare/v0.11.0...v1.0.0)
372
392
 
@@ -397,3 +417,25 @@
397
417
  * Use different working directories based on test suite - RSpec, Cucumber.
398
418
  It's `tmp/rspec` and `tmp/cucumber` now to make sure they do not overwrite
399
419
  the test results from each other.
420
+ * The use of `@interactive` is discontinued. You need to use
421
+ `#last_command_started`-method to get access to the interactively started
422
+ command.
423
+ * If multiple commands have been started, each output has to be check
424
+ separately
425
+
426
+ ```cucumber
427
+ Scenario: Detect stdout from all processes
428
+ When I run `printf "hello world!\n"`
429
+ And I run `cat` interactively
430
+ And I type "hola"
431
+ And I type ""
432
+ Then the stdout should contain:
433
+ """
434
+ hello world!
435
+ """
436
+ And the stdout should contain:
437
+ """
438
+ hola
439
+ """
440
+ And the stderr should not contain anything
441
+ ```
data/README.md CHANGED
@@ -115,15 +115,19 @@ can test those commands as though the gem were already installed.
115
115
 
116
116
  If you need other directories to be added to the `PATH`, you can put the following in `features/support/env.rb`:
117
117
 
118
- ENV['PATH'] = "/my/special/bin/path#{File::PATH_SEPARATOR}#{ENV['PATH']}"
118
+ ```ruby
119
+ Aruba.configure do |config|
120
+ config.command_search_paths = config.command_search_paths << '/my/special/bin/path'
121
+ end
122
+ ```
119
123
 
120
124
  ### Increasing timeouts
121
125
 
122
- A process sometimes takes longer than expected to terminate, and Aruba will kill them off (and fail your scenario) if it is still alive after 3 seconds. If you need more time you can modify the timeout by assigning a different value to `@aruba_timeout_seconds` in a `Before` block:
126
+ A process sometimes takes longer than expected to terminate, and Aruba will kill them off (and fail your scenario) if it is still alive after 3 seconds. If you need more time you can modify the timeout by assigning a different value to `#exit_timeout` in a `Aruba.configure` block:
123
127
 
124
128
  ```ruby
125
- Before do
126
- @aruba_timeout_seconds = 5
129
+ Aruba.configure do |config|
130
+ config.exit_timeout = 5
127
131
  end
128
132
  ```
129
133
 
@@ -132,11 +136,11 @@ end
132
136
  Running processes interactively can result in race conditions when Aruba executes an IO-related step
133
137
  but the interactive process has not yet flushed or read some content. To help prevent this Aruba waits
134
138
  before reading or writing to the process if it is still running. You can control the wait by setting
135
- `@aruba_io_wait_seconds` to an appropriate value. This is particularly useful with tags:
139
+ `aruba.config.io_wait_timeout` to an appropriate value. This is particularly useful with tags:
136
140
 
137
141
  ```ruby
138
142
  Before('@slow_process') do
139
- @aruba_io_wait_seconds = 5
143
+ aruba.config.io_wait_timeout = 5
140
144
  end
141
145
  ```
142
146
 
data/TODO.md CHANGED
@@ -1,3 +1,8 @@
1
-
2
1
  * Replace check filesystem permissons through a better rspec matcher
3
2
  * Improve documentation for matchers in file
3
+ * Cleanup stdout/stderr in spawn process:
4
+ It should be enough to use 'open(@process.io.stdout).read' and 'open(@process.io.stderr).read'. There's no need to rewind them.
5
+ * Ensure that all processes are kill after cucumber is finished
6
+ * Add variation of check and stop of command if output contains
7
+ Add something like `(?: of last command)?`. If this is true, just check the last command.
8
+ * Use aruba.config.exit_timeout everywhere
@@ -2,16 +2,20 @@
2
2
  require 'ffi'
3
3
  java_version = (RUBY_DESCRIPTION.match(/.*?on.*?(1\.[\d]\..*? )/))[1] if defined?(JRUBY_VERSION)
4
4
 
5
- std_opts = "--color --exclude features/fixtures --require features"
5
+ std_opts = "--color --exclude features/fixtures --require features --tags ~@unsupported-on"
6
6
  java_default_opts = "--tags ~@wip-jruby-java-1.6" if defined?(JRUBY_VERSION) && (java_version < '1.7.0')
7
7
  java_wip_opts = "--tags @wip-jruby-java-1.6:3" if defined?(JRUBY_VERSION) && (java_version < '1.7.0')
8
8
 
9
9
  ignore_opts = []
10
- ignore_opts << "--tags ~@ignore-platform-java" if RUBY_PLATFORM.include? 'java'
11
- ignore_opts << "--tags ~@ignore-platform-mri" if !RUBY_PLATFORM.include? 'java'
12
- ignore_opts << "--tags ~@ignore-platform-windows" if FFI::Platform.windows?
13
- ignore_opts << "--tags ~@ignore-platform-unix" if FFI::Platform.unix?
14
- ignore_opts << "--tags ~@ignore-platform-mac" if FFI::Platform.mac?
10
+ ignore_opts << '--tags ~@ignore'
11
+ ignore_opts << '--tags ~@unsupported-on-platform-java' if RUBY_PLATFORM.include? 'java'
12
+ ignore_opts << '--tags ~@unsupported-on-platform-mri' if !RUBY_PLATFORM.include? 'java'
13
+ ignore_opts << '--tags ~@unsupported-on-platform-windows' if FFI::Platform.windows?
14
+ ignore_opts << '--tags ~@unsupported-on-platform-unix' if FFI::Platform.unix?
15
+ ignore_opts << '--tags ~@unsupported-on-platform-mac' if FFI::Platform.mac?
16
+ ignore_opts << '--tags ~@unsupported-on-ruby-older-2' if RUBY_VERSION < '2'
17
+ ignore_opts << '--tags ~@unsupported-on-ruby-older-193' if RUBY_VERSION < '1.9.3'
18
+ ignore_opts << '--tags ~@unsupported-on-ruby-older-19' if RUBY_VERSION < '1.9'
15
19
  ignore_opts = ignore_opts.join(' ')
16
20
  %>
17
21
  default: <%= std_opts %> --tags ~@wip <%= java_default_opts %> <%= ignore_opts %>
@@ -0,0 +1,72 @@
1
+ - README.md
2
+ - getting_started (Getting Started):
3
+ - install.feature (Install Aruba)
4
+ - supported_programming_languages.feature (Supportet Programming Languages)
5
+ - ruby_api (Ruby API):
6
+ - expand_path.feature (#expand_path)
7
+ - cleanup_aruba_directory.feature (#setup_aruba)
8
+ - run.feature (#run)
9
+ - which.feature (#which)
10
+ - append_environment_variable.feature (#append_environment_variable)
11
+ - prepend_environment_variable.feature (#prepend_environment_variable)
12
+ - set_environment_variable.feature (#set_environment_variable)
13
+ - cd.feature (#cd)
14
+ - create_directory.feature (#create_directory)
15
+ - disk_usage.feature (#disk_usage)
16
+ - does_exist.feature (#exist?)
17
+ - is_absolute.feature (#absolute?)
18
+ - filesystem/is_directory.feature (#directory?)
19
+ - is_file.feature (#file?)
20
+ - is_relative.feature(#relative?)
21
+ - move.feature (#move)
22
+ - file_system_commands.feature
23
+ - command.feature (Before Hook)
24
+ - command.feature (After Hook)
25
+ - cucumber (Cucumber):
26
+ - debug_command.feature (Debug Commmands)
27
+ - environment_variables.feature (Environment Variables)
28
+ - flushing.feature (Flush Output)
29
+ - interactive.feature (Interactive Commands)
30
+ - all_output.feature (Command Output)
31
+ - stdout.feature (STDOUT)
32
+ - configuration (Configuration):
33
+ - exit_timeout.feature (Exit Timeout)
34
+ - fixtures_directories.feature (Fixtures Directories)
35
+ - fixtures_path_prefix.feature (Fixture Path Prefix)
36
+ - home_directory.feature (Home Directory)
37
+ - io_timeout.feature (IO Wait Timeout)
38
+ - keep_ansi.feature (Keep ANSI output)
39
+ - log_level.feature (Log Level)
40
+ - physical_block_size.feature (Physical Block Size)
41
+ - root_directory.feature (Root Directory)
42
+ - working_directory.feature (Working Directory)
43
+ - rspec (RSpec):
44
+ - getting_started.feature (Integration)
45
+ - include_an_object.feature (Matcher: Include an Object)
46
+ - have_sub_directory.feature (Matcher: Have Sub Directory)
47
+ - be_existing_file.feature (Matcher: Be Existing File)
48
+ - have_file_content.feature (Matcher: Have File Content)
49
+ - have_file_size.feature (Matcher: Have File Size)
50
+ - be_an_absolute_path.feature (Matcher: Be Absolute Path)
51
+ - be_an_existing_path.feature (Matcher: Be Existing Path)
52
+ - have_permissions.feature (Matcher: Have Permissions)
53
+ - timeouts.feature (Matcher: Timeouts)
54
+ - cucumber (Cucumber):
55
+ - announce.feature (Announce Information to User)
56
+ - exit_statuses.feature (Exit Status of Commands)
57
+ - in_process.feature (Start Commands in Process)
58
+ - run.feature (Run Commands)
59
+ - home_variable.feature (Modify HOME-Variable)
60
+ - set_environment_variable.feature (Set Environment variables)
61
+ - copy.feature (Copy files/directories)
62
+ - create_directory.feature (Create Directories)
63
+ - create_file.feature (Create Files)
64
+ - file_content.feature (Use File Content)
65
+ - move.feature (Move files/directories)
66
+ - overwrite_file.feature (Overwrite Files)
67
+ - use_fixture.feature (Use Fixtures)
68
+ - output.feature (Output)
69
+ - utf-8.feature (Support for UTF-8-strings)
70
+ - development (Development):
71
+ - build.feature (Build Aruba)
72
+ - test.feature (Test Aruba)
@@ -0,0 +1,203 @@
1
+ Feature: Announce output during test run
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: Announce change of directory (deprecated)
11
+ Given a file named "features/exit_status.feature" with:
12
+ """cucumber
13
+ Feature: Announce
14
+ @announce-dir
15
+ Scenario: Run command
16
+ Given a directory named "dir.d"
17
+ When I cd to "dir.d"
18
+ """
19
+ When I run `cucumber`
20
+ Then the features should all pass
21
+ And the output should contain:
22
+ """
23
+ $ cd /
24
+ """
25
+ And the output should contain:
26
+ """
27
+ tmp/aruba/dir.d
28
+ """
29
+
30
+ Scenario: Announce change of directory
31
+ Given a file named "features/exit_status.feature" with:
32
+ """cucumber
33
+ Feature: Announce
34
+ @announce-directory
35
+ Scenario: Run command
36
+ Given a directory named "dir.d"
37
+ When I cd to "dir.d"
38
+ """
39
+ When I run `cucumber`
40
+ Then the features should all pass
41
+ And the output should contain:
42
+ """
43
+ $ cd /
44
+ """
45
+ And the output should contain:
46
+ """
47
+ tmp/aruba/dir.d
48
+ """
49
+
50
+ Scenario: Announce stdout
51
+ Given an executable named "bin/cli" with:
52
+ """bash
53
+ #!/usr/bin/env bash
54
+
55
+ echo 'Hello World'
56
+ """
57
+ And a file named "features/exit_status.feature" with:
58
+ """cucumber
59
+ Feature: Announce
60
+ @announce-stdout
61
+ Scenario: Run command
62
+ When I run `cli`
63
+ Then the exit status should be 0
64
+ """
65
+ When I run `cucumber`
66
+ Then the features should all pass
67
+ And the output should contain:
68
+ """
69
+ <<-STDOUT
70
+ Hello World
71
+
72
+ STDOUT
73
+ """
74
+
75
+ Scenario: Announce stderr
76
+ Given an executable named "bin/cli" with:
77
+ """bash
78
+ #!/usr/bin/env bash
79
+
80
+ echo 'Hello World' >&2
81
+ """
82
+ And a file named "features/exit_status.feature" with:
83
+ """cucumber
84
+ Feature: Announce
85
+ @announce-stderr
86
+ Scenario: Run command
87
+ When I run `cli`
88
+ Then the exit status should be 0
89
+ """
90
+ When I run `cucumber`
91
+ Then the features should all pass
92
+ And the output should contain:
93
+ """
94
+ <<-STDERR
95
+ Hello World
96
+
97
+ STDERR
98
+ """
99
+
100
+ Scenario: Announce both stderr and stdout
101
+ Given an executable named "bin/cli" with:
102
+ """bash
103
+ #!/usr/bin/env bash
104
+
105
+ echo 'Hello' >&2
106
+ echo 'World'
107
+ """
108
+ And a file named "features/exit_status.feature" with:
109
+ """cucumber
110
+ Feature: Announce
111
+ @announce-output
112
+ Scenario: Run command
113
+ When I run `cli`
114
+ Then the exit status should be 0
115
+ """
116
+ When I run `cucumber`
117
+ Then the features should all pass
118
+ And the output should contain:
119
+ """
120
+ <<-STDERR
121
+ Hello
122
+
123
+ STDERR
124
+ """
125
+ And the output should contain:
126
+ """
127
+ <<-STDOUT
128
+ World
129
+
130
+ STDOUT
131
+ """
132
+
133
+ Scenario: Announce command
134
+ Given an executable named "bin/cli" with:
135
+ """bash
136
+ #!/usr/bin/env bash
137
+
138
+ echo 'Hello World'
139
+ """
140
+ And a file named "features/exit_status.feature" with:
141
+ """cucumber
142
+ Feature: Announce
143
+ @announce-cmd
144
+ Scenario: Run command
145
+ When I run `cli`
146
+ Then the exit status should be 0
147
+ """
148
+ When I run `cucumber`
149
+ Then the features should all pass
150
+ And the output should contain:
151
+ """
152
+ $ cli
153
+ """
154
+
155
+ Scenario: Announce change of environment variable
156
+ Given an executable named "bin/cli" with:
157
+ """bash
158
+ #!/usr/bin/env bash
159
+
160
+ echo 'Hello World'
161
+ """
162
+ And a file named "features/exit_status.feature" with:
163
+ """cucumber
164
+ Feature: Announce
165
+ @announce-env
166
+ Scenario: Run command
167
+ When I set the environment variables to:
168
+ | variable | value |
169
+ | MY_VAR | my_value |
170
+ And I run `cli`
171
+ Then the exit status should be 0
172
+ """
173
+ When I run `cucumber`
174
+ Then the features should all pass
175
+ And the output should contain:
176
+ """
177
+ $ export MY_VAR=my_value
178
+ """
179
+
180
+ Scenario: Announce change of environment variable which contains special characters
181
+ Given an executable named "bin/cli" with:
182
+ """bash
183
+ #!/usr/bin/env bash
184
+
185
+ echo 'Hello World'
186
+ """
187
+ And a file named "features/exit_status.feature" with:
188
+ """cucumber
189
+ Feature: Announce
190
+ @announce-env
191
+ Scenario: Run command
192
+ When I set the environment variables to:
193
+ | variable | value |
194
+ | MY_VAR | my value ! |
195
+ And I run `cli`
196
+ Then the exit status should be 0
197
+ """
198
+ When I run `cucumber`
199
+ Then the features should all pass
200
+ And the output should contain:
201
+ """
202
+ $ export MY_VAR=my\ value\ \
203
+ """