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.
- checksums.yaml +4 -4
- data/Gemfile +8 -3
- data/History.md +61 -19
- data/README.md +10 -6
- data/TODO.md +6 -1
- data/cucumber.yml +10 -6
- data/features/.nav +72 -0
- data/features/announce.feature +203 -0
- data/features/api/command/extract_text.feature +10 -0
- data/features/api/command/run.feature +6 -6
- data/features/api/command/stop_all_commands.feature +53 -0
- data/features/api/command/terminate_all_commands.feature +53 -0
- data/features/api/command/unescape_text.feature +12 -0
- data/features/api/command/which.feature +3 -3
- data/features/api/core/expand_path.feature +4 -4
- data/features/api/environment/append_environment_variable.feature +18 -8
- data/features/api/environment/prepend_environment_variable.feature +18 -8
- data/features/api/environment/set_environment_variable.feature +33 -16
- data/features/api/filesystem/cd.feature +23 -13
- data/features/api/filesystem/create_directory.feature +2 -2
- data/features/api/filesystem/disk_usage.feature +7 -6
- data/features/api/filesystem/does_exist.feature +2 -2
- data/features/api/filesystem/is_absolute.feature +2 -2
- data/features/api/filesystem/is_directory.feature +2 -2
- data/features/api/filesystem/is_file.feature +2 -2
- data/features/api/filesystem/is_relative.feature +2 -2
- data/features/api/filesystem/move.feature +119 -0
- data/features/cli/console.feature +3 -3
- data/features/commands/debug_command.feature +93 -0
- data/features/commands/environment_variables.feature +64 -0
- data/features/commands/flushing.feature +74 -0
- data/features/commands/interactive.feature +90 -0
- data/features/commands/output/all_output.feature +445 -0
- data/features/commands/output/stdout.feature +66 -0
- data/features/configuration/exit_timeout.feature +5 -5
- data/features/configuration/fixtures_directories.feature +3 -3
- data/features/configuration/fixtures_path_prefix.feature +1 -1
- data/features/configuration/home_directory.feature +4 -4
- data/features/configuration/io_timeout.feature +2 -2
- data/features/configuration/keep_ansi.feature +2 -2
- data/features/configuration/log_level.feature +3 -3
- data/features/configuration/physical_block_size.feature +3 -3
- data/features/configuration/usage.feature +159 -0
- data/features/core/cleanup_aruba_directory.feature +52 -0
- data/features/development/build.feature +16 -0
- data/features/development/test.feature +24 -0
- data/features/file_system_commands.feature +12 -12
- data/features/getting_started/supported_programming_languages.feature +89 -0
- data/features/hooks/after/command.feature +1 -1
- data/features/hooks/before/command.feature +2 -2
- data/features/matchers/collection/include_an_object.feature +72 -0
- data/features/matchers/timeouts.feature +2 -2
- data/features/output.feature +60 -181
- data/features/step_definitions/aruba_dev_steps.rb +17 -10
- data/features/step_definitions/hooks.rb +11 -0
- data/features/steps/commands/exit_statuses.feature +3 -3
- data/features/steps/commands/run.feature +0 -15
- data/features/steps/filesystem/copy.feature +45 -0
- data/features/steps/filesystem/create_directory.feature +47 -0
- data/features/steps/filesystem/create_file.feature +53 -0
- data/features/steps/filesystem/file_content.feature +1 -1
- data/features/steps/filesystem/move.feature +45 -0
- data/features/steps/filesystem/overwrite_file.feature +72 -0
- data/features/steps/filesystem/use_fixture.feature +77 -0
- data/features/usage/install.feature +8 -0
- data/{features/fixtures → fixtures}/cli-app/.gitignore +0 -0
- data/{features/fixtures → fixtures}/cli-app/.rspec +0 -0
- data/{features/fixtures → fixtures}/cli-app/README.md +0 -0
- data/{features/fixtures → fixtures}/cli-app/Rakefile +0 -0
- data/{features/fixtures → fixtures}/cli-app/bin/cli +0 -0
- data/{features/fixtures → fixtures}/cli-app/cli-app.gemspec +0 -0
- data/{features/fixtures → fixtures}/cli-app/features/support/env.rb +0 -0
- data/{features/fixtures → fixtures}/cli-app/lib/cli/app.rb +0 -0
- data/fixtures/cli-app/lib/cli/app/suppress_simple_cov_output.rb +15 -0
- data/{features/fixtures → fixtures}/cli-app/lib/cli/app/version.rb +0 -0
- data/{features/fixtures/empty-app → fixtures/cli-app}/script/console +3 -3
- data/{features/fixtures → fixtures}/cli-app/spec/spec_helper.rb +0 -0
- data/{features/fixtures → fixtures}/cli-app/spec/support/aruba.rb +0 -0
- data/{features/fixtures → fixtures}/copy/file.txt +0 -0
- data/{features/fixtures → fixtures}/empty-app/.gitignore +0 -0
- data/{features/fixtures → fixtures}/empty-app/.rspec +0 -0
- data/{features/fixtures → fixtures}/empty-app/README.md +0 -0
- data/{features/fixtures → fixtures}/empty-app/Rakefile +0 -0
- data/{features/fixtures → fixtures}/empty-app/bin/cli +0 -0
- data/{features/fixtures → fixtures}/empty-app/cli-app.gemspec +0 -0
- data/{features/fixtures → fixtures}/empty-app/lib/cli/app.rb +0 -0
- data/{features/fixtures → fixtures}/empty-app/lib/cli/app/version.rb +0 -0
- data/{features/fixtures/cli-app → fixtures/empty-app}/script/console +3 -3
- data/{features/fixtures → fixtures}/empty-app/spec/spec_helper.rb +0 -0
- data/{features/fixtures → fixtures}/fixtures-app/test.txt +0 -0
- data/fixtures/getting-started-app/.gitignore +4 -0
- data/fixtures/getting-started-app/Gemfile +4 -0
- data/fixtures/getting-started-app/README.md +3 -0
- data/fixtures/getting-started-app/features/support/env.rb +1 -0
- data/{features/fixtures → fixtures}/spawn_process/stderr.sh +0 -0
- data/lib/aruba/announcer.rb +6 -2
- data/lib/aruba/api.rb +0 -16
- data/lib/aruba/api/command.rb +64 -266
- data/lib/aruba/api/core.rb +24 -26
- data/lib/aruba/api/deprecated.rb +370 -12
- data/lib/aruba/api/filesystem.rb +64 -15
- data/lib/aruba/aruba_path.rb +4 -0
- data/lib/aruba/config.rb +1 -1
- data/lib/aruba/cucumber.rb +5 -449
- data/lib/aruba/cucumber/command.rb +378 -0
- data/lib/aruba/cucumber/core.rb +29 -0
- data/lib/aruba/cucumber/environment.rb +30 -0
- data/lib/aruba/cucumber/file.rb +210 -0
- data/lib/aruba/cucumber/hooks.rb +11 -14
- data/lib/aruba/cucumber/rvm.rb +3 -0
- data/lib/aruba/matchers/base/base_matcher.rb +94 -0
- data/lib/aruba/matchers/collection.rb +1 -0
- data/lib/aruba/matchers/collection/all_objects.rb +2 -0
- data/lib/aruba/matchers/collection/include_an_object.rb +120 -0
- data/lib/aruba/matchers/command/be_successfully_executed.rb +3 -3
- data/lib/aruba/matchers/command/have_exit_status.rb +2 -11
- data/lib/aruba/matchers/command/have_finished_in_time.rb +5 -5
- data/lib/aruba/matchers/command/have_output.rb +46 -0
- data/lib/aruba/matchers/command/have_output_on_stderr.rb +42 -0
- data/lib/aruba/matchers/command/have_output_on_stdout.rb +42 -0
- data/lib/aruba/matchers/command/have_output_size.rb +28 -0
- data/lib/aruba/matchers/directory/be_an_existing_directory.rb +1 -1
- data/lib/aruba/matchers/file/be_an_existing_file.rb +1 -1
- data/lib/aruba/matchers/file/have_file_content.rb +1 -1
- data/lib/aruba/matchers/file/have_file_size.rb +2 -2
- data/lib/aruba/matchers/file/have_same_file_content.rb +1 -1
- data/lib/aruba/matchers/path/have_permissions.rb +1 -1
- data/lib/aruba/platforms/aruba_file_creator.rb +2 -3
- data/lib/aruba/platforms/aruba_fixed_size_file_creator.rb +2 -3
- data/lib/aruba/platforms/determine_disk_usage.rb +23 -0
- data/lib/aruba/platforms/determine_file_size.rb +13 -0
- data/lib/aruba/platforms/disk_usage_calculator.rb +11 -0
- data/lib/aruba/platforms/local_environment.rb +15 -0
- data/lib/aruba/platforms/unix_environment_variables.rb +1 -1
- data/lib/aruba/platforms/unix_platform.rb +35 -14
- data/lib/aruba/process_monitor.rb +53 -7
- data/lib/aruba/processes/basic_process.rb +25 -5
- data/lib/aruba/processes/debug_process.rb +27 -25
- data/lib/aruba/processes/in_process.rb +7 -22
- data/lib/aruba/processes/spawn_process.rb +74 -31
- data/lib/aruba/rspec.rb +1 -6
- data/lib/aruba/version.rb +1 -1
- data/script/console +0 -1
- data/spec/aruba/api/environment/restore_env_spec.rb +65 -0
- data/spec/aruba/api/environment/set_env_spec.rb +42 -0
- data/spec/aruba/api/filesystem/file_size_spec.rb +28 -0
- data/spec/aruba/api_spec.rb +10 -7
- data/spec/aruba/matchers/command/have_output_size_spec.rb +25 -0
- data/spec/aruba/matchers/command_spec.rb +135 -4
- data/spec/aruba/spawn_process_spec.rb +1 -1
- metadata +107 -65
- data/.nav +0 -12
- data/features/debug.feature +0 -15
- data/features/fixtures/cli-app/spec/cli/app_spec.rb +0 -7
- data/features/flushing.feature +0 -26
- data/features/interactive.feature +0 -66
- data/features/no_clobber.feature +0 -25
- 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
|
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
|
-
|
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
|
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
|
-
|
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
|
-
|
107
|
-
|
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
|
@@ -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
|
@@ -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
|
+
"""
|