aruba 0.9.0.pre → 0.9.0.pre2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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
@@ -25,30 +25,32 @@ Then /^the following step should fail with Spec::Expectations::ExpectationNotMet
25
25
  expect{steps multiline_step.to_s}.to raise_error(RSpec::Expectations::ExpectationNotMetError)
26
26
  end
27
27
 
28
- Then /^the output should be (\d+) bytes long$/ do |length|
29
- expect(all_output.length).to eq length.to_i
30
- end
31
-
32
28
  Then /^the feature(?:s)? should( not)?(?: all)? pass$/ do |negated|
33
29
  if negated
34
30
  step 'the output should contain " failed)"'
35
31
  step 'the exit status should be 1'
36
32
  else
37
33
  step 'the output should not contain " failed)"'
34
+ step 'the output should not contain " undefined)"'
38
35
  step 'the exit status should be 0'
39
36
  end
40
37
  end
41
38
 
42
- Then /^the feature(?:s)? should( not)?(?: all)? pass with:$/ do |negated, string|
39
+ Then /^the feature(?:s)? should( not)?(?: all)? pass with( regex)?:$/ do |negated, regex, string|
43
40
  if negated
44
41
  step 'the output should contain " failed)"'
45
42
  step 'the exit status should be 1'
46
43
  else
47
44
  step 'the output should not contain " failed)"'
45
+ step 'the output should not contain " undefined)"'
48
46
  step 'the exit status should be 0'
49
47
  end
50
48
 
51
- step 'the output should contain:', string if string
49
+ if regex
50
+ step "the output should match %r<#{string}>"
51
+ else
52
+ step 'the output should contain:', string
53
+ end
52
54
  end
53
55
 
54
56
  Then /^the spec(?:s)? should( not)?(?: all)? pass(?: with (\d+) failures?)?$/ do |negated, count_failures|
@@ -66,7 +68,7 @@ Then /^the spec(?:s)? should( not)?(?: all)? pass(?: with (\d+) failures?)?$/ do
66
68
  end
67
69
  end
68
70
 
69
- Then /^the spec(?:s)? should( not)?(?: all)? pass with:$/ do |negated, string|
71
+ Then /^the spec(?:s)? should( not)?(?: all)? pass with( regex)?:$/ do |negated, regex, string|
70
72
  if negated
71
73
  step 'the output should contain " failed)"'
72
74
  step 'the exit status should be 1'
@@ -75,7 +77,11 @@ Then /^the spec(?:s)? should( not)?(?: all)? pass with:$/ do |negated, string|
75
77
  step 'the exit status should be 0'
76
78
  end
77
79
 
78
- step 'the output should contain:', string if string
80
+ if regex
81
+ step "the output should match %r<#{string}>"
82
+ else
83
+ step 'the output should contain:', string
84
+ end
79
85
  end
80
86
 
81
87
  Given(/^the default executable$/) do
@@ -103,6 +109,7 @@ Given(/^the default feature-test$/) do
103
109
  )
104
110
  end
105
111
 
106
- Given(/^(?:an|the) executable(?: named)? "([^"]*)" with:$/) do |file_name, file_content|
107
- step %(a file named "#{file_name}" with mode "0755" and with:), file_content
112
+ Then(/^aruba should be installed on the local system$/) do
113
+ run('gem list aruba')
114
+ expect(last_command_started).to have_output(/aruba/)
108
115
  end
@@ -0,0 +1,11 @@
1
+ require 'cucumber/platform'
2
+
3
+ Before '@requires-ruby-version-193' do
4
+ next unless RUBY_VERSION < '1.9.3'
5
+
6
+ if Cucumber::VERSION < '2'
7
+ pending
8
+ else
9
+ skip_this_scenario
10
+ end
11
+ end
@@ -94,7 +94,7 @@ Feature: Check exit status of commands
94
94
  """
95
95
  Feature: Failing program
96
96
  Scenario: Run command
97
- Given the default aruba timeout is 2 seconds
97
+ Given the default aruba exit timeout is 2 seconds
98
98
  When I successfully run `cli`
99
99
  """
100
100
  When I run `cucumber`
@@ -110,7 +110,7 @@ Feature: Check exit status of commands
110
110
  """
111
111
  Feature: Failing program
112
112
  Scenario: Run command
113
- Given the default aruba timeout is 0 seconds
113
+ Given the default aruba exit timeout is 0 seconds
114
114
  When I successfully run `cli` for up to 2 seconds
115
115
  """
116
116
  When I run `cucumber`
@@ -126,7 +126,7 @@ Feature: Check exit status of commands
126
126
  """
127
127
  Feature: Failing program
128
128
  Scenario: Run command
129
- Given the default aruba timeout is 0 seconds
129
+ Given the default aruba exit timeout is 0 seconds
130
130
  When I successfully run `cli` for up to 1 seconds
131
131
  """
132
132
  When I run `cucumber`
@@ -19,18 +19,3 @@ Feature: Run commands
19
19
  """
20
20
  When I run `cucumber`
21
21
  Then the features should all pass
22
-
23
- Scenario: Relative command
24
- Given an executable named "bin/cli" with:
25
- """
26
- #!/bin/bash
27
- exit 0
28
- """
29
- And a file named "features/run.feature" with:
30
- """
31
- Feature: Run it
32
- Scenario: Run command
33
- When I run `bin/cli`
34
- """
35
- When I run `cucumber`
36
- Then the features should all pass
@@ -0,0 +1,45 @@
1
+ Feature: Copy file or directory
2
+
3
+ As a user of aruba
4
+ I want ot copy a file or a directory
5
+ To setup my tests
6
+
7
+ Background:
8
+ Given I use a fixture named "cli-app"
9
+
10
+ Scenario: Copy file
11
+ Given a file named "features/copy.feature" with:
12
+ """
13
+ Feature: Copy
14
+ Scenario: Copy
15
+ Given an empty file named "file1.txt"
16
+ And an empty file named "file2.txt"
17
+ And an empty file named "file3.txt"
18
+ When I copy a file named "file1.txt" to "new_file1.txt"
19
+ When I copy a file from "file2.txt" to "new_file2.txt"
20
+ When I copy the file "file3.txt" to "new_file3.txt"
21
+ Then a file named "new_file1.txt" should exist
22
+ Then a file named "new_file2.txt" should exist
23
+ Then a file named "new_file3.txt" should exist
24
+ """
25
+ When I run `cucumber`
26
+ Then the features should all pass
27
+
28
+ Scenario: Copy directory
29
+ Given a file named "features/copy.feature" with:
30
+ """
31
+ Feature: Copy
32
+ Scenario: Copy
33
+ Given a directory named "dir1.d"
34
+ And a directory named "dir2.d"
35
+ And a directory named "dir3.d"
36
+ When I copy a directory named "dir1.d" to "new_dir1.d"
37
+ When I copy a directory from "dir2.d" to "new_dir2.d"
38
+ When I copy the directory "dir3.d" to "new_dir3.d"
39
+ Then a directory named "new_dir1.d" should exist
40
+ Then a directory named "new_dir2.d" should exist
41
+ Then a directory named "new_dir3.d" should exist
42
+ """
43
+ When I run `cucumber`
44
+ Then the features should all pass
45
+
@@ -0,0 +1,47 @@
1
+ Feature: Create Directory
2
+
3
+ As a user of aruba
4
+ I want to create directories
5
+
6
+ Background:
7
+ Given I use a fixture named "cli-app"
8
+
9
+ Scenario: Non-existing directory
10
+ Given a file named "features/create_directory.feature" with:
11
+ """
12
+ Feature: Create directory
13
+ Scenario: Create directory
14
+ Given a directory named "dir1"
15
+ Given the directory "dir2"
16
+ Given the directory named "dir3"
17
+ Then a directory named "dir1" should exist
18
+ And a directory named "dir2" should exist
19
+ And a directory named "dir3" should exist
20
+ """
21
+ When I run `cucumber`
22
+ Then the features should all pass
23
+
24
+ Scenario: Existing directory
25
+
26
+ It doesn't matter if a directory already exist.
27
+
28
+ Given a file named "features/create_directory.feature" with:
29
+ """
30
+ Feature: Create directory
31
+ Scenario: Create directory
32
+ Given a directory named "dir1"
33
+ And a directory named "dir1"
34
+ """
35
+ When I run `cucumber`
36
+ Then the features should all pass
37
+
38
+ Scenario: Change mode a long with creation of directory
39
+ Given a file named "features/create_directory.feature" with:
40
+ """
41
+ Feature: Create directory
42
+ Scenario: Create directory
43
+ Given a directory named "dir1" with mode "0644"
44
+ Then the directory named "dir1" should have permissions "0644"
45
+ """
46
+ When I run `cucumber`
47
+ Then the features should all pass
@@ -0,0 +1,53 @@
1
+ Feature: Create new File
2
+
3
+ As a user of aruba
4
+ I want to create files
5
+
6
+ Background:
7
+ Given I use a fixture named "cli-app"
8
+
9
+ Scenario: Create empty file
10
+ Given a file named "features/create_file.feature" with:
11
+ """
12
+ Feature: Create file
13
+ Scenario: Create file
14
+ Given an empty file named "file1.txt"
15
+ Then a file named "file1.txt" should exist
16
+ """
17
+ When I run `cucumber`
18
+ Then the features should all pass
19
+
20
+ Scenario: Create file with content
21
+ Given a file named "features/create_file.feature" with:
22
+ """
23
+ Feature: Create file
24
+ Scenario: Create file
25
+ Given a file named "file1.txt" with:
26
+ \"\"\"
27
+ Hello World
28
+ \"\"\"
29
+ Then the file named "file1.txt" should contain:
30
+ \"\"\"
31
+ Hello World
32
+ \"\"\"
33
+ """
34
+ When I run `cucumber`
35
+ Then the features should all pass
36
+
37
+ Scenario: Change mode a long with creation of file
38
+ Given a file named "features/create_file.feature" with:
39
+ """
40
+ Feature: Create directory
41
+ Scenario: Create directory
42
+ Given a file named "file1.txt" with mode "0644" and with:
43
+ \"\"\"
44
+ Hello World
45
+ \"\"\"
46
+ Then the file named "file1.txt" should have permissions "0644"
47
+ And the file named "file1.txt" should contain:
48
+ \"\"\"
49
+ Hello World
50
+ \"\"\"
51
+ """
52
+ When I run `cucumber`
53
+ Then the features should all pass
@@ -42,7 +42,7 @@ Feature: Check file content
42
42
 
43
43
  \"\"\"
44
44
  """
45
- When I run `cucumber`
45
+ When I run `cucumber --format progress`
46
46
  Then the features should all pass
47
47
 
48
48
  Scenario: Trailing white space is ignored
@@ -0,0 +1,45 @@
1
+ Feature: Move file or directory
2
+
3
+ As a user of aruba
4
+ I want ot move a file or a directory
5
+ To setup my tests
6
+
7
+ Background:
8
+ Given I use a fixture named "cli-app"
9
+
10
+ Scenario: Move file
11
+ Given a file named "features/move.feature" with:
12
+ """
13
+ Feature: Move
14
+ Scenario: Move
15
+ Given an empty file named "file1.txt"
16
+ And an empty file named "file2.txt"
17
+ And an empty file named "file3.txt"
18
+ When I move a file named "file1.txt" to "new_file1.txt"
19
+ When I move a file from "file2.txt" to "new_file2.txt"
20
+ When I move the file "file3.txt" to "new_file3.txt"
21
+ Then a file named "new_file1.txt" should exist
22
+ Then a file named "new_file2.txt" should exist
23
+ Then a file named "new_file3.txt" should exist
24
+ """
25
+ When I run `cucumber`
26
+ Then the features should all pass
27
+
28
+ Scenario: Move directory
29
+ Given a file named "features/move.feature" with:
30
+ """
31
+ Feature: Move
32
+ Scenario: Move
33
+ Given a directory named "dir1.d"
34
+ And a directory named "dir2.d"
35
+ And a directory named "dir3.d"
36
+ When I move a directory named "dir1.d" to "new_dir1.d"
37
+ When I move a directory from "dir2.d" to "new_dir2.d"
38
+ When I move the directory "dir3.d" to "new_dir3.d"
39
+ Then a directory named "new_dir1.d" should exist
40
+ Then a directory named "new_dir2.d" should exist
41
+ Then a directory named "new_dir3.d" should exist
42
+ """
43
+ When I run `cucumber`
44
+ Then the features should all pass
45
+
@@ -0,0 +1,72 @@
1
+ Feature: Overwrite a file
2
+
3
+ As a user of aruba
4
+ I want to overwrite a file
5
+
6
+ Background:
7
+ Given I use a fixture named "cli-app"
8
+
9
+ Scenario: Overwrite an existing file
10
+ Given a file named "features/create_file.feature" with:
11
+ """
12
+ Feature: Overwrite file
13
+ Scenario: Overwrite file
14
+ Given a file named "file1.txt" with:
15
+ \"\"\"
16
+ Hello World
17
+ \"\"\"
18
+ And a file named "file2.txt" with:
19
+ \"\"\"
20
+ Hello World
21
+ \"\"\"
22
+ And a file named "file3.txt" with:
23
+ \"\"\"
24
+ Hello World
25
+ \"\"\"
26
+ When I overwrite "file1.txt" with:
27
+ \"\"\"
28
+ Hello Universe
29
+ \"\"\"
30
+ When I overwrite the file "file2.txt" with:
31
+ \"\"\"
32
+ Hello Universe
33
+ \"\"\"
34
+ When I overwrite a file named "file3.txt" with:
35
+ \"\"\"
36
+ Hello Universe
37
+ \"\"\"
38
+ Then the file named "file1.txt" should contain:
39
+ \"\"\"
40
+ Hello Universe
41
+ \"\"\"
42
+ And the file named "file2.txt" should contain:
43
+ \"\"\"
44
+ Hello Universe
45
+ \"\"\"
46
+ And the file named "file3.txt" should contain:
47
+ \"\"\"
48
+ Hello Universe
49
+ \"\"\"
50
+ """
51
+ When I run `cucumber`
52
+ Then the features should all pass
53
+
54
+ Scenario: Overwrite a non-existing file
55
+ Given a file named "features/create_file.feature" with:
56
+ """
57
+ Feature: Overwrite file
58
+ Scenario: Overwrite file
59
+ When I overwrite "file1.txt" with:
60
+ \"\"\"
61
+ Hello Universe
62
+ \"\"\"
63
+ Then the file named "file1.txt" should contain:
64
+ \"\"\"
65
+ Hello Universe
66
+ \"\"\"
67
+ """
68
+ When I run `cucumber`
69
+ Then the features should not all pass with regex:
70
+ """
71
+ Expected [^ ]+ to be present
72
+ """
@@ -0,0 +1,77 @@
1
+ Feature: Use a fixture
2
+
3
+ As a user of aruba
4
+ I want to use a fixture
5
+
6
+ Background:
7
+ Given I use a fixture named "cli-app"
8
+
9
+ Scenario: Use the fixture if fixtures directory is in root directory
10
+ Given a file named "features/use_fixtures.feature" with:
11
+ """
12
+ Feature: Use Fixture
13
+ Scenario: Use Fixture
14
+ Given I use a fixture named "my-app"
15
+ Then a file named "MY-APP-README.md" should exist
16
+ """
17
+ And a directory named "fixtures"
18
+ And a directory named "fixtures/my-app"
19
+ And an empty file named "fixtures/my-app/MY-APP-README.md"
20
+ When I run `cucumber`
21
+ Then the features should all pass
22
+
23
+ Scenario: Use the fixture if fixtures directory is in features-directory
24
+ Given a file named "features/use_fixtures.feature" with:
25
+ """
26
+ Feature: Use Fixture
27
+ Scenario: Use Fixture
28
+ Given I use a fixture named "my-app"
29
+ Then a file named "MY-APP-README.md" should exist
30
+ """
31
+ And a directory named "features/fixtures"
32
+ And a directory named "features/fixtures/my-app"
33
+ And an empty file named "features/fixtures/my-app/MY-APP-README.md"
34
+ When I run `cucumber`
35
+ Then the features should all pass
36
+
37
+ Scenario: Use the fixture if fixtures directory is in spec-directory
38
+ Given a file named "features/use_fixtures.feature" with:
39
+ """
40
+ Feature: Use Fixture
41
+ Scenario: Use Fixture
42
+ Given I use a fixture named "my-app"
43
+ Then a file named "MY-APP-README.md" should exist
44
+ """
45
+ And a directory named "spec/fixtures"
46
+ And a directory named "spec/fixtures/my-app"
47
+ And an empty file named "spec/fixtures/my-app/MY-APP-README.md"
48
+ When I run `cucumber`
49
+ Then the features should all pass
50
+
51
+ Scenario: Use the fixture if fixtures directory is in test-directory
52
+ Given a file named "features/use_fixtures.feature" with:
53
+ """
54
+ Feature: Use Fixture
55
+ Scenario: Use Fixture
56
+ Given I use a fixture named "my-app"
57
+ Then a file named "MY-APP-README.md" should exist
58
+ """
59
+ And a directory named "test/fixtures"
60
+ And a directory named "test/fixtures/my-app"
61
+ And an empty file named "test/fixtures/my-app/MY-APP-README.md"
62
+ When I run `cucumber`
63
+ Then the features should all pass
64
+
65
+ Scenario: Fails if fixture does not exist
66
+ Given a file named "features/use_fixtures.feature" with:
67
+ """
68
+ Feature: Use Fixture
69
+ Scenario: Use Fixture
70
+ Given I use a fixture named "my-app"
71
+ """
72
+ And a directory named "fixtures"
73
+ When I run `cucumber`
74
+ Then the features should not all pass with regex:
75
+ """
76
+ Fixture "my-app" does not exist in fixtures directory ".+/fixtures"
77
+ """