aruba 0.11.0.pre4 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/History.md +11 -3
  3. data/README.md +32 -311
  4. data/aruba.gemspec +1 -1
  5. data/features/api/filesystem/fixtures.feature +104 -0
  6. data/features/{core/cleanup_aruba_directory.feature → getting_started/cleanup.feature} +16 -1
  7. data/features/{usage → getting_started}/install.feature +0 -0
  8. data/features/getting_started/writing_good_feature_tests.feature +38 -0
  9. data/features/hooks/after/command.feature +10 -0
  10. data/features/hooks/before/command.feature +10 -0
  11. data/features/platforms/jruby.feature +14 -0
  12. data/features/{commands/debug_command.feature → steps/command/debug.feature} +0 -0
  13. data/features/steps/command/in_process.feature +11 -0
  14. data/features/{commands → steps/command}/interactive.feature +1 -1
  15. data/features/{commands/output/all_output.feature → steps/command/output.feature} +142 -0
  16. data/features/steps/command/stderr.feature +68 -0
  17. data/features/{commands/output → steps/command}/stdout.feature +45 -2
  18. data/features/{announce.feature → steps/core/announce.feature} +0 -0
  19. data/features/steps/filesystem/append_to_file.feature +45 -0
  20. data/features/steps/filesystem/cd_to_directory.feature +33 -0
  21. data/features/steps/filesystem/check_file_content.feature +61 -0
  22. data/features/steps/filesystem/check_permissions_of_file.feature +39 -0
  23. data/features/steps/filesystem/compare_files.feature +42 -0
  24. data/features/steps/filesystem/create_directory.feature +15 -5
  25. data/features/steps/filesystem/create_file.feature +26 -3
  26. data/features/steps/filesystem/existence_of_directory.feature +57 -0
  27. data/features/steps/filesystem/existence_of_file.feature +43 -0
  28. data/features/steps/filesystem/file_content.feature +22 -0
  29. data/features/steps/filesystem/fixtures.feature +64 -0
  30. data/features/steps/filesystem/non_existence_of_directory.feature +69 -0
  31. data/features/steps/filesystem/non_existence_of_file.feature +80 -0
  32. data/features/steps/filesystem/remove_directory.feature +38 -0
  33. data/features/steps/filesystem/remove_file.feature +38 -0
  34. data/lib/aruba/cucumber/file.rb +17 -15
  35. data/lib/aruba/version.rb +1 -1
  36. metadata +52 -31
  37. data/features/commands/environment_variables.feature +0 -64
  38. data/features/commands/flushing.feature +0 -74
  39. data/features/file_system_commands.feature +0 -220
  40. data/features/output.feature +0 -131
  41. data/features/utf-8.feature +0 -14
  42. data/fixtures/fixtures-app/test.txt +0 -1
@@ -0,0 +1,80 @@
1
+ Feature: Make sure and check a file does not exist
2
+
3
+ To setup a working environment, you may want to make sure, that a
4
+ file does not exist or if you ran your command of a file
5
+ was deleted.
6
+
7
+ Background:
8
+ Given I use a fixture named "cli-app"
9
+
10
+ Scenario: Delete existing file
11
+ Given a file named "features/non-existence.feature" with:
12
+ """
13
+ Feature: Non-Existence
14
+ Background:
15
+ Given a file named "example.txt" does not exist
16
+
17
+ Scenario: Non-Existence #1
18
+ Then the file "example.txt" should not exist
19
+
20
+ Scenario: Non-Existence #2
21
+ Then the file "example.txt" should not exist
22
+
23
+ Scenario: Non-Existence #3
24
+ Then the file "example.txt" should not exist
25
+ """
26
+ When I run `cucumber`
27
+ Then the features should all pass
28
+
29
+ Scenario: Check if a file does not exists
30
+ Given a file named "features/non-existence.feature" with:
31
+ """
32
+ Feature: Non-Existence
33
+ Background:
34
+ Given a file named "example.txt" does not exist
35
+
36
+ Scenario: Non-Existence #1
37
+ Then the file "example.txt" should not exist
38
+
39
+ Scenario: Non-Existence #2
40
+ Then the file named "example.txt" should not exist
41
+
42
+ Scenario: Non-Existence #3
43
+ Then a file named "example.txt" should not exist
44
+
45
+ Scenario: Non-Existence #4
46
+ Then a file named "example.txt" should not exist anymore
47
+
48
+ Scenario: Non-Existence #5
49
+ Then the file named "example.txt" should not exist anymore
50
+
51
+ Scenario: Non-Existence #6
52
+ Then the file "example.txt" should not exist anymore
53
+ """
54
+ When I run `cucumber`
55
+ Then the features should all pass
56
+
57
+ Scenario: Check for absence of multiple files
58
+ Given a file named "features/non-existence.feature" with:
59
+ """
60
+ Feature: Non-Existence
61
+ Scenario: Non-Existence
62
+ Given the file "lorem/ipsum/dolor.txt" does not exist
63
+ Given the file "lorem/ipsum/sit.txt" does not exist
64
+ Then the following files should not exist:
65
+ | lorem/ipsum/dolor.txt |
66
+ | lorem/ipsum/sit.txt |
67
+ """
68
+ When I run `cucumber`
69
+ Then the features should all pass
70
+
71
+ Scenario: Check for absence of a single file using a regex
72
+ Given a file named "features/non-existence.feature" with:
73
+ """
74
+ Feature: Existence
75
+ Scenario: Existence
76
+ Given the file "lorem/ipsum/sit.txt" does not exist
77
+ Then a file matching %r<^ipsum> should not exist
78
+ """
79
+ When I run `cucumber`
80
+ Then the features should all pass
@@ -0,0 +1,38 @@
1
+ Feature: Remove a directory
2
+
3
+ Background:
4
+ Given I use a fixture named "cli-app"
5
+
6
+ Scenario: Remove an existing directory
7
+ Given a file named "features/non-existence.feature" with:
8
+ """
9
+ Feature: Remove
10
+ Scenario: Remove
11
+ Given an empty directory named "foo"
12
+ When I remove the directory "foo"
13
+ Then the directory "foo" should not exist
14
+ """
15
+ When I run `cucumber`
16
+ Then the features should all pass
17
+
18
+ Scenario: Remove an non-existing directory
19
+ Given a file named "features/non-existence.feature" with:
20
+ """
21
+ Feature: Remove
22
+ Scenario: Remove
23
+ When I remove the directory "foo"
24
+ Then the directory "foo" should not exist
25
+ """
26
+ When I run `cucumber`
27
+ Then the features should not pass
28
+
29
+ Scenario: Force remove an non-existing directory
30
+ Given a file named "features/non-existence.feature" with:
31
+ """
32
+ Feature: Remove
33
+ Scenario: Remove
34
+ When I remove the directory "foo" with full force
35
+ Then the directory "foo" should not exist
36
+ """
37
+ When I run `cucumber`
38
+ Then the features should all pass
@@ -0,0 +1,38 @@
1
+ Feature: Remove a file
2
+
3
+ Background:
4
+ Given I use a fixture named "cli-app"
5
+
6
+ Scenario: Remove an existing file
7
+ Given a file named "features/non-existence.feature" with:
8
+ """
9
+ Feature: Remove
10
+ Scenario: Remove
11
+ Given an empty file named "foo"
12
+ When I remove the file "foo"
13
+ Then the file "foo" should not exist
14
+ """
15
+ When I run `cucumber`
16
+ Then the features should all pass
17
+
18
+ Scenario: Remove an non-existing file
19
+ Given a file named "features/non-existence.feature" with:
20
+ """
21
+ Feature: Remove
22
+ Scenario: Remove
23
+ When I remove the file "foo"
24
+ Then the file "foo" should not exist
25
+ """
26
+ When I run `cucumber`
27
+ Then the features should not pass
28
+
29
+ Scenario: Force remove an non-existing file
30
+ Given a file named "features/non-existence.feature" with:
31
+ """
32
+ Feature: Remove
33
+ Scenario: Remove
34
+ When I remove the file "foo" with full force
35
+ Then the file "foo" should not exist
36
+ """
37
+ When I run `cucumber`
38
+ Then the features should all pass
@@ -11,7 +11,7 @@ Given(/^I move (?:a|the) (file|directory)(?: (?:named|from))? "([^"]*)" to "([^"
11
11
  move source, destination
12
12
  end
13
13
 
14
- Given(/^(?:a|the) directory(?: named)? "([^"]*)"$/) do |dir_name|
14
+ Given(/^(?:a|the|(?:an empty)) directory(?: named)? "([^"]*)"$/) do |dir_name|
15
15
  create_directory(dir_name)
16
16
  end
17
17
 
@@ -66,8 +66,8 @@ When(/^I append to "([^"]*)" with "([^"]*)"$/) do |file_name, file_content|
66
66
  append_to_file(file_name, file_content)
67
67
  end
68
68
 
69
- When(/^I remove (?:a|the) (?:file|directory)(?: named)? "([^"]*)"$/) do |name|
70
- remove(name)
69
+ When(/^I remove (?:a|the) (?:file|directory)(?: named)? "([^"]*)"( with full force)?$/) do |name, force_remove|
70
+ remove(name, :force => force_remove.nil? ? false : true)
71
71
  end
72
72
 
73
73
  Given(/^(?:a|the) (?:file|directory)(?: named)? "([^"]*)" does not exist$/) do |name|
@@ -88,11 +88,21 @@ Then(/^the following files should (not )?exist:$/) do |negated, files|
88
88
  end
89
89
  end
90
90
 
91
- Then(/^(?:a|the) file(?: named)? "([^"]*)" should (not )?exist(?: anymore)?$/) do |file, expect_match|
92
- if expect_match
93
- expect(file).not_to be_an_existing_file
91
+ Then(/^(?:a|the) (file|directory)(?: named)? "([^"]*)" should (not )?exist(?: anymore)?$/) do |directory_or_file, path, expect_match|
92
+ if directory_or_file == 'file'
93
+ if expect_match
94
+ expect(path).not_to be_an_existing_file
95
+ else
96
+ expect(path).to be_an_existing_file
97
+ end
98
+ elsif directory_or_file == 'directory'
99
+ if expect_match
100
+ expect(path).not_to be_an_existing_directory
101
+ else
102
+ expect(path).to be_an_existing_directory
103
+ end
94
104
  else
95
- expect(file).to be_an_existing_file
105
+ fail ArgumentError, %("#{directory_or_file}" can only be "directory" or "file".)
96
106
  end
97
107
  end
98
108
 
@@ -122,14 +132,6 @@ Then(/^the following directories should (not )?exist:$/) do |negated, directorie
122
132
  end
123
133
  end
124
134
 
125
- Then(/^(?:a|the) directory(?: named)? "([^"]*)" should (not )?exist$/) do |directory, negated|
126
- if negated
127
- expect(directory).not_to be_an_existing_directory
128
- else
129
- expect(directory).to be_an_existing_directory
130
- end
131
- end
132
-
133
135
  Then(/^(?:a|the) file(?: named)? "([^"]*)" should (not )?contain "([^"]*)"$/) do |file, negated, content|
134
136
  if negated
135
137
  expect(file).not_to have_file_content file_content_including(content.chomp)
@@ -1,3 +1,3 @@
1
1
  module Aruba
2
- VERSION = '0.11.0.pre4'
2
+ VERSION = '0.11.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aruba
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0.pre4
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aslak Hellesøy
@@ -105,14 +105,14 @@ dependencies:
105
105
  requirements:
106
106
  - - "~>"
107
107
  - !ruby/object:Gem::Version
108
- version: 0.2.0
108
+ version: '0.2'
109
109
  type: :runtime
110
110
  prerelease: false
111
111
  version_requirements: !ruby/object:Gem::Requirement
112
112
  requirements:
113
113
  - - "~>"
114
114
  - !ruby/object:Gem::Version
115
- version: 0.2.0
115
+ version: '0.2'
116
116
  - !ruby/object:Gem::Dependency
117
117
  name: bundler
118
118
  requirement: !ruby/object:Gem::Requirement
@@ -156,7 +156,6 @@ files:
156
156
  - cucumber.yml
157
157
  - doc/dependency_decisions.yml
158
158
  - features/.nav
159
- - features/announce.feature
160
159
  - features/api/command/find_command.feature
161
160
  - features/api/command/last_command_started.feature
162
161
  - features/api/command/last_command_stopped.feature
@@ -175,6 +174,7 @@ files:
175
174
  - features/api/filesystem/create_directory.feature
176
175
  - features/api/filesystem/disk_usage.feature
177
176
  - features/api/filesystem/does_exist.feature
177
+ - features/api/filesystem/fixtures.feature
178
178
  - features/api/filesystem/is_absolute.feature
179
179
  - features/api/filesystem/is_directory.feature
180
180
  - features/api/filesystem/is_file.feature
@@ -186,12 +186,6 @@ files:
186
186
  - features/api/text/unescape_text.feature
187
187
  - features/cli/console.feature
188
188
  - features/cli/init.feature
189
- - features/commands/debug_command.feature
190
- - features/commands/environment_variables.feature
191
- - features/commands/flushing.feature
192
- - features/commands/interactive.feature
193
- - features/commands/output/all_output.feature
194
- - features/commands/output/stdout.feature
195
189
  - features/configuration/console_history_file.feature
196
190
  - features/configuration/exit_timeout.feature
197
191
  - features/configuration/fixtures_directories.feature
@@ -206,12 +200,13 @@ files:
206
200
  - features/configuration/startup_wait_time.feature
207
201
  - features/configuration/usage.feature
208
202
  - features/configuration/working_directory.feature
209
- - features/core/cleanup_aruba_directory.feature
210
203
  - features/development/build.feature
211
204
  - features/development/test.feature
212
- - features/file_system_commands.feature
205
+ - features/getting_started/cleanup.feature
206
+ - features/getting_started/install.feature
213
207
  - features/getting_started/run_commands.feature
214
208
  - features/getting_started/supported_testing_frameworks.feature
209
+ - features/getting_started/writing_good_feature_tests.feature
215
210
  - features/hooks/after/command.feature
216
211
  - features/hooks/before/command.feature
217
212
  - features/matchers/collection/include_an_object.feature
@@ -224,31 +219,47 @@ files:
224
219
  - features/matchers/path/be_an_existing_path.feature
225
220
  - features/matchers/path/have_permissions.feature
226
221
  - features/matchers/timeouts.feature
227
- - features/output.feature
222
+ - features/platforms/jruby.feature
228
223
  - features/rspec/integration.feature
229
224
  - features/step_definitions/aruba_dev_steps.rb
230
225
  - features/step_definitions/hooks.rb
226
+ - features/steps/command/debug.feature
231
227
  - features/steps/command/exit_statuses.feature
232
228
  - features/steps/command/in_process.feature
229
+ - features/steps/command/interactive.feature
230
+ - features/steps/command/output.feature
233
231
  - features/steps/command/run.feature
234
232
  - features/steps/command/send_signal.feature
233
+ - features/steps/command/stderr.feature
234
+ - features/steps/command/stdout.feature
235
235
  - features/steps/command/stop.feature
236
+ - features/steps/core/announce.feature
236
237
  - features/steps/environment/home_variable.feature
237
238
  - features/steps/environment/set_environment_variable.feature
239
+ - features/steps/filesystem/append_to_file.feature
240
+ - features/steps/filesystem/cd_to_directory.feature
241
+ - features/steps/filesystem/check_file_content.feature
242
+ - features/steps/filesystem/check_permissions_of_file.feature
243
+ - features/steps/filesystem/compare_files.feature
238
244
  - features/steps/filesystem/copy.feature
239
245
  - features/steps/filesystem/create_directory.feature
240
246
  - features/steps/filesystem/create_file.feature
247
+ - features/steps/filesystem/existence_of_directory.feature
248
+ - features/steps/filesystem/existence_of_file.feature
241
249
  - features/steps/filesystem/file_content.feature
250
+ - features/steps/filesystem/fixtures.feature
242
251
  - features/steps/filesystem/move.feature
252
+ - features/steps/filesystem/non_existence_of_directory.feature
253
+ - features/steps/filesystem/non_existence_of_file.feature
243
254
  - features/steps/filesystem/overwrite_file.feature
255
+ - features/steps/filesystem/remove_directory.feature
256
+ - features/steps/filesystem/remove_file.feature
244
257
  - features/steps/filesystem/use_fixture.feature
245
258
  - features/steps/overview.feature
246
259
  - features/support/aruba.rb
247
260
  - features/support/env.rb
248
261
  - features/support/jruby.rb
249
262
  - features/support/simplecov_setup.rb
250
- - features/usage/install.feature
251
- - features/utf-8.feature
252
263
  - fixtures/cli-app/.gitignore
253
264
  - fixtures/cli-app/.rspec
254
265
  - fixtures/cli-app/README.md
@@ -270,7 +281,6 @@ files:
270
281
  - fixtures/empty-app/cli-app.gemspec
271
282
  - fixtures/empty-app/lib/cli/app.rb
272
283
  - fixtures/empty-app/lib/cli/app/version.rb
273
- - fixtures/fixtures-app/test.txt
274
284
  - fixtures/getting-started-app/.gitignore
275
285
  - fixtures/getting-started-app/Gemfile
276
286
  - fixtures/getting-started-app/README.md
@@ -453,17 +463,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
453
463
  version: 1.8.7
454
464
  required_rubygems_version: !ruby/object:Gem::Requirement
455
465
  requirements:
456
- - - ">"
466
+ - - ">="
457
467
  - !ruby/object:Gem::Version
458
- version: 1.3.1
468
+ version: '0'
459
469
  requirements: []
460
470
  rubyforge_project:
461
471
  rubygems_version: 2.4.5.1
462
472
  signing_key:
463
473
  specification_version: 4
464
- summary: aruba-0.11.0.pre4
474
+ summary: aruba-0.11.1
465
475
  test_files:
466
- - features/announce.feature
467
476
  - features/api/command/find_command.feature
468
477
  - features/api/command/last_command_started.feature
469
478
  - features/api/command/last_command_stopped.feature
@@ -482,6 +491,7 @@ test_files:
482
491
  - features/api/filesystem/create_directory.feature
483
492
  - features/api/filesystem/disk_usage.feature
484
493
  - features/api/filesystem/does_exist.feature
494
+ - features/api/filesystem/fixtures.feature
485
495
  - features/api/filesystem/is_absolute.feature
486
496
  - features/api/filesystem/is_directory.feature
487
497
  - features/api/filesystem/is_file.feature
@@ -493,12 +503,6 @@ test_files:
493
503
  - features/api/text/unescape_text.feature
494
504
  - features/cli/console.feature
495
505
  - features/cli/init.feature
496
- - features/commands/debug_command.feature
497
- - features/commands/environment_variables.feature
498
- - features/commands/flushing.feature
499
- - features/commands/interactive.feature
500
- - features/commands/output/all_output.feature
501
- - features/commands/output/stdout.feature
502
506
  - features/configuration/console_history_file.feature
503
507
  - features/configuration/exit_timeout.feature
504
508
  - features/configuration/fixtures_directories.feature
@@ -513,12 +517,13 @@ test_files:
513
517
  - features/configuration/startup_wait_time.feature
514
518
  - features/configuration/usage.feature
515
519
  - features/configuration/working_directory.feature
516
- - features/core/cleanup_aruba_directory.feature
517
520
  - features/development/build.feature
518
521
  - features/development/test.feature
519
- - features/file_system_commands.feature
522
+ - features/getting_started/cleanup.feature
523
+ - features/getting_started/install.feature
520
524
  - features/getting_started/run_commands.feature
521
525
  - features/getting_started/supported_testing_frameworks.feature
526
+ - features/getting_started/writing_good_feature_tests.feature
522
527
  - features/hooks/after/command.feature
523
528
  - features/hooks/before/command.feature
524
529
  - features/matchers/collection/include_an_object.feature
@@ -531,31 +536,47 @@ test_files:
531
536
  - features/matchers/path/be_an_existing_path.feature
532
537
  - features/matchers/path/have_permissions.feature
533
538
  - features/matchers/timeouts.feature
534
- - features/output.feature
539
+ - features/platforms/jruby.feature
535
540
  - features/rspec/integration.feature
536
541
  - features/step_definitions/aruba_dev_steps.rb
537
542
  - features/step_definitions/hooks.rb
543
+ - features/steps/command/debug.feature
538
544
  - features/steps/command/exit_statuses.feature
539
545
  - features/steps/command/in_process.feature
546
+ - features/steps/command/interactive.feature
547
+ - features/steps/command/output.feature
540
548
  - features/steps/command/run.feature
541
549
  - features/steps/command/send_signal.feature
550
+ - features/steps/command/stderr.feature
551
+ - features/steps/command/stdout.feature
542
552
  - features/steps/command/stop.feature
553
+ - features/steps/core/announce.feature
543
554
  - features/steps/environment/home_variable.feature
544
555
  - features/steps/environment/set_environment_variable.feature
556
+ - features/steps/filesystem/append_to_file.feature
557
+ - features/steps/filesystem/cd_to_directory.feature
558
+ - features/steps/filesystem/check_file_content.feature
559
+ - features/steps/filesystem/check_permissions_of_file.feature
560
+ - features/steps/filesystem/compare_files.feature
545
561
  - features/steps/filesystem/copy.feature
546
562
  - features/steps/filesystem/create_directory.feature
547
563
  - features/steps/filesystem/create_file.feature
564
+ - features/steps/filesystem/existence_of_directory.feature
565
+ - features/steps/filesystem/existence_of_file.feature
548
566
  - features/steps/filesystem/file_content.feature
567
+ - features/steps/filesystem/fixtures.feature
549
568
  - features/steps/filesystem/move.feature
569
+ - features/steps/filesystem/non_existence_of_directory.feature
570
+ - features/steps/filesystem/non_existence_of_file.feature
550
571
  - features/steps/filesystem/overwrite_file.feature
572
+ - features/steps/filesystem/remove_directory.feature
573
+ - features/steps/filesystem/remove_file.feature
551
574
  - features/steps/filesystem/use_fixture.feature
552
575
  - features/steps/overview.feature
553
576
  - features/support/aruba.rb
554
577
  - features/support/env.rb
555
578
  - features/support/jruby.rb
556
579
  - features/support/simplecov_setup.rb
557
- - features/usage/install.feature
558
- - features/utf-8.feature
559
580
  - spec/aruba/api/environment/restore_env_spec.rb
560
581
  - spec/aruba/api/environment/set_env_spec.rb
561
582
  - spec/aruba/api/filesystem/file_size_spec.rb