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
data/.nav DELETED
@@ -1,12 +0,0 @@
1
- README.md
2
- # before_cmd_hooks.feature
3
- # command_environment_variables.feature
4
- # configuration-rspec.feature
5
- # custom_ruby_process.feature
6
- # exit_statuses.feature
7
- # file_system_commands.feature
8
- # flushing.feature
9
- # interactive.feature
10
- # no_clobber.feature
11
- # output.feature
12
- # utf-8.feature
@@ -1,15 +0,0 @@
1
- Feature: Debug command execution
2
-
3
- As a developer
4
- I want to use some debugger in my code and therefor need system() to execute my program
5
- In order to find a bug
6
-
7
- @debug
8
- Scenario: Run program with debug code
9
- When I run `true`
10
- Then the exit status should be 0
11
-
12
- @debug
13
- Scenario: Run failing program with debug code
14
- When I run `false`
15
- Then the exit status should be 1
@@ -1,7 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Cli::App do
4
- it 'has a version number' do
5
- expect(Cli::App::VERSION).not_to be nil
6
- end
7
- end
@@ -1,26 +0,0 @@
1
- Feature: Flushing output
2
-
3
- In order to test processes that output a lot of data
4
- As a developer using Aruba
5
- I want to make sure that large amounts of output aren't buffered
6
-
7
- Scenario: A little output
8
- When I run `bash -c 'for ((c=0; c<256; c = c+1)); do echo -n "a"; done'`
9
- Then the output should contain "a"
10
- And the output should be 256 bytes long
11
- And the exit status should be 0
12
-
13
- Scenario: Tons of output
14
- Given the default aruba timeout is 10 seconds
15
- When I run `bash -c 'for ((c=0; c<65536; c = c+1)); do echo -n "a"; done'`
16
- Then the output should contain "a"
17
- And the output should be 65536 bytes long
18
- And the exit status should be 0
19
-
20
- Scenario: Tons of interactive output
21
- Given the default aruba timeout is 10 seconds
22
- When I run `bash -c 'read size; for ((c=0; c<$size; c = c+1)); do echo -n "a"; done'` interactively
23
- And I type "65536"
24
- Then the output should contain "a"
25
- And the output should be 65536 bytes long
26
- # And the exit status should be 0
@@ -1,66 +0,0 @@
1
- Feature: Interactive process control
2
-
3
- In order to test interactive command line applications
4
- As a developer using Cucumber
5
- I want to use the interactive session steps
6
-
7
- @wip-jruby-java-1.6
8
- Scenario: Running ruby interactively
9
- Given a file named "echo.rb" with:
10
- """
11
- while res = gets.chomp
12
- break if res == "quit"
13
- puts res.reverse
14
- end
15
- """
16
- When I run `ruby echo.rb` interactively
17
- And I type "hello, world"
18
- And I type "quit"
19
- Then it should pass with:
20
- """
21
- dlrow ,olleh
22
- """
23
-
24
- @posix
25
- Scenario: Running a native binary interactively
26
- When I run `cat` interactively
27
- And I type "Hello, world"
28
- And I type ""
29
- Then the output should contain:
30
- """
31
- Hello, world
32
- """
33
-
34
- @posix
35
- Scenario: Pipe in a file
36
- Given a file named "test.txt" with:
37
- """
38
- line1
39
- line2
40
- """
41
- When I run `cat` interactively
42
- And I pipe in the file "test.txt"
43
- Then the output should contain:
44
- """
45
- line1
46
- line2
47
- """
48
-
49
- @posix
50
- Scenario: Close stdin stream
51
- When I run `cat` interactively
52
- And I type "Hello, world"
53
- And I close the stdin stream
54
- Then the output should contain:
55
- """
56
- Hello, world
57
- """
58
-
59
- @posix
60
- Scenario: Stop processes before checking for filesystem changes
61
- See: http://github.com/aslakhellesoy/aruba/issues#issue/17 for context
62
-
63
- Given a directory named "rename_me"
64
- When I run `mv rename_me renamed` interactively
65
- Then the directory "renamed" should exist
66
- And the directory "rename_me" should not exist
@@ -1,25 +0,0 @@
1
- Feature: No clobber
2
-
3
- By default Aruba removes its scratch directory before
4
- every scenario. This isn't always the right thing
5
- to do, especially when the path to the default directory
6
- has been changed. Use @no-clobber to stop Aruba from
7
- cleaning up after itself.
8
-
9
- Scenario: Change the filesystem
10
- Given a directory named "foo/bar"
11
- And a file named "foo/bar/baz.txt" with:
12
- """
13
- I don't want to die!
14
- """
15
-
16
- @no-clobber
17
- Scenario: Verify nothing was clobbered
18
- Then a file named "foo/bar/baz.txt" should exist
19
- And the file "foo/bar/baz.txt" should contain exactly:
20
- """
21
- I don't want to die!
22
- """
23
-
24
- Scenario: Cleanup and verify the previous scenario
25
- Then a file named "foo/bar/baz.txt" should not exist
@@ -1,7 +0,0 @@
1
- module Aruba
2
- class DiskUsageCalculator
3
- def calc(blocks, block_size)
4
- FileSize.new(blocks * block_size)
5
- end
6
- end
7
- end