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.
- 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
@@ -4,18 +4,18 @@ Feature: file system commands
|
|
4
4
|
As a developer using Cucumber
|
5
5
|
I want to create temporary files
|
6
6
|
|
7
|
-
Scenario: create a dir
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
Scenario: create a file
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
7
|
+
# Scenario: create a dir
|
8
|
+
# Given a directory named "foo/bar"
|
9
|
+
# When I run `file foo/bar`
|
10
|
+
# Then the stdout should contain "foo/bar: directory"
|
11
|
+
|
12
|
+
# Scenario: create a file
|
13
|
+
# Given a file named "foo/bar/example.txt" with:
|
14
|
+
# """
|
15
|
+
# hello world
|
16
|
+
# """
|
17
|
+
# When I run `cat foo/bar/example.txt`
|
18
|
+
# Then the output should contain exactly "hello world"
|
19
19
|
|
20
20
|
Scenario: a file does not exist
|
21
21
|
Given a file named "example.txt" does not exist
|
@@ -0,0 +1,89 @@
|
|
1
|
+
Feature: Supported programming languages
|
2
|
+
|
3
|
+
As long as you've got the neccessary programs, libraries, runtime
|
4
|
+
environments, interpreters installed, it doesn't matter in which programming
|
5
|
+
language your commandline application is implemented.
|
6
|
+
|
7
|
+
Below you find some examples of the "Hello, Aruba!"-application implemented
|
8
|
+
with different programming languages. This is NOT an exclusive list. Every
|
9
|
+
commandline application should run with `aruba`.
|
10
|
+
|
11
|
+
Background:
|
12
|
+
Given I use a fixture named "getting-started-app"
|
13
|
+
And a file named "features/hello_aruba.feature" with:
|
14
|
+
"""
|
15
|
+
Feature: Getting Started With Aruba
|
16
|
+
Scenario: First Run of Command
|
17
|
+
Given I successfully run `cli`
|
18
|
+
Then the output should contain:
|
19
|
+
\"\"\"
|
20
|
+
Hello, Aruba!
|
21
|
+
\"\"\"
|
22
|
+
"""
|
23
|
+
|
24
|
+
Scenario: Bash Program
|
25
|
+
Given an executable named "bin/cli" with:
|
26
|
+
"""bash
|
27
|
+
#!/usr/bin/env bash
|
28
|
+
|
29
|
+
echo "Hello, Aruba!"
|
30
|
+
"""
|
31
|
+
When I successfully run `cucumber`
|
32
|
+
Then the features should all pass
|
33
|
+
|
34
|
+
Scenario: Ruby Program
|
35
|
+
Given an executable named "bin/cli" with:
|
36
|
+
"""ruby
|
37
|
+
#!/usr/bin/env ruby
|
38
|
+
|
39
|
+
puts "Hello, Aruba!"
|
40
|
+
"""
|
41
|
+
When I successfully run `cucumber`
|
42
|
+
Then the features should all pass
|
43
|
+
|
44
|
+
Scenario: Python Program
|
45
|
+
Given an executable named "bin/cli" with:
|
46
|
+
"""python
|
47
|
+
#!/usr/bin/env python
|
48
|
+
|
49
|
+
print("Hello, Aruba!")
|
50
|
+
"""
|
51
|
+
When I successfully run `cucumber`
|
52
|
+
Then the features should all pass
|
53
|
+
|
54
|
+
Scenario: Perl Program
|
55
|
+
Given an executable named "bin/cli" with:
|
56
|
+
"""perl
|
57
|
+
#!/usr/bin/env perl
|
58
|
+
|
59
|
+
print "Hello, Aruba!\n";
|
60
|
+
"""
|
61
|
+
When I successfully run `cucumber`
|
62
|
+
Then the features should all pass
|
63
|
+
|
64
|
+
Scenario: Java Program
|
65
|
+
|
66
|
+
It's even possible to compile and run Java programs with Aruba.
|
67
|
+
|
68
|
+
Given a file named "features/hello_aruba.feature" with:
|
69
|
+
"""cucumber
|
70
|
+
Feature: Getting Started With Aruba
|
71
|
+
Scenario: First Run of Command
|
72
|
+
Given a file named "tmp/HelloArubaApp.java" with:
|
73
|
+
\"\"\"
|
74
|
+
class HelloArubaApp {
|
75
|
+
public static void main(String[] args) {
|
76
|
+
System.out.println("Hello, Aruba!");
|
77
|
+
}
|
78
|
+
}
|
79
|
+
\"\"\"
|
80
|
+
And I successfully run `javac tmp/HelloArubaApp.java`
|
81
|
+
And I cd to "tmp/"
|
82
|
+
And I successfully run `java HelloArubaApp`
|
83
|
+
Then the output should contain:
|
84
|
+
\"\"\"
|
85
|
+
Hello, Aruba!
|
86
|
+
\"\"\"
|
87
|
+
"""
|
88
|
+
When I successfully run `cucumber`
|
89
|
+
Then the features should all pass
|
@@ -22,7 +22,7 @@ Feature: After command hooks
|
|
22
22
|
RSpec.describe 'Hooks', :type => :aruba do
|
23
23
|
before(:each) { run_simple 'echo running' }
|
24
24
|
|
25
|
-
it { expect(
|
25
|
+
it { expect(last_command_started.stdout.chomp).to eq 'running' }
|
26
26
|
end
|
27
27
|
"""
|
28
28
|
When I run `rspec`
|
@@ -24,7 +24,7 @@ Feature: before_cmd hooks
|
|
24
24
|
RSpec.describe 'Hooks', :type => :aruba do
|
25
25
|
before(:each) { run_simple 'echo running' }
|
26
26
|
|
27
|
-
it { expect(
|
27
|
+
it { expect(last_command_started.stdout.chomp).to eq 'running' }
|
28
28
|
end
|
29
29
|
"""
|
30
30
|
When I run `rspec`
|
@@ -50,7 +50,7 @@ Feature: before_cmd hooks
|
|
50
50
|
RSpec.describe 'Hooks', :type => :aruba do
|
51
51
|
before(:each) { run_simple 'echo running' }
|
52
52
|
|
53
|
-
it { expect(
|
53
|
+
it { expect(last_command_started.stdout.chomp).to eq 'running' }
|
54
54
|
end
|
55
55
|
"""
|
56
56
|
When I run `rspec`
|
@@ -0,0 +1,72 @@
|
|
1
|
+
Feature: `include_an_object` Matcher
|
2
|
+
|
3
|
+
Use the `include_an_object` matcher to specify that a collection's objects include_an_object pass an expected matcher.
|
4
|
+
This works on include_an_object enumerable object.
|
5
|
+
|
6
|
+
```ruby
|
7
|
+
expect([1, 4, 5]).to include_an_object( be_odd )
|
8
|
+
expect([1, 3, 'a']).to include_an_object( be_an(Integer) )
|
9
|
+
expect([1, 3, 11]).to include_an_object( be < 10 )
|
10
|
+
```
|
11
|
+
|
12
|
+
The matcher also supports compound matchers:
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
expect([1, 'a', 11]).to include_an_object( be_odd.and be < 10 )
|
16
|
+
```
|
17
|
+
|
18
|
+
Background:
|
19
|
+
Given I use a fixture named "cli-app"
|
20
|
+
|
21
|
+
Scenario: Array usage
|
22
|
+
Given a file named "spec/array_include_an_object_matcher_spec.rb" with:
|
23
|
+
"""ruby
|
24
|
+
require 'spec_helper'
|
25
|
+
|
26
|
+
RSpec.describe [1, 4, 'a', 11] do
|
27
|
+
it { is_expected.to include_an_object( be_odd ) }
|
28
|
+
it { is_expected.to include_an_object( be_an(Integer) ) }
|
29
|
+
it { is_expected.to include_an_object( be < 10 ) }
|
30
|
+
it { is_expected.not_to include_an_object( eq 'b' ) }
|
31
|
+
end
|
32
|
+
|
33
|
+
RSpec.describe [14, 'a'] do
|
34
|
+
it { is_expected.to include_an_object( be_odd ) }
|
35
|
+
it { is_expected.to include_an_object( be_an(Symbol) ) }
|
36
|
+
it { is_expected.to include_an_object( be < 10 ) }
|
37
|
+
it { is_expected.not_to include_an_object( eq 'a' ) }
|
38
|
+
end
|
39
|
+
"""
|
40
|
+
When I run `rspec`
|
41
|
+
Then the output should contain all of these lines:
|
42
|
+
| 8 examples, 4 failures |
|
43
|
+
| expected [14, "a"] to include an object be odd |
|
44
|
+
| expected [14, "a"] to include an object be a kind of Symbol |
|
45
|
+
| expected [14, "a"] to include an object be < 10 |
|
46
|
+
| expected [14, "a"] not to include an object eq "a" |
|
47
|
+
|
48
|
+
Scenario: Compound Matcher Usage
|
49
|
+
Given a file named "spec/compound_include_an_object_matcher_spec.rb" with:
|
50
|
+
"""ruby
|
51
|
+
require 'spec_helper'
|
52
|
+
|
53
|
+
RSpec.describe [1, 'anything', 'something'] do
|
54
|
+
it { is_expected.to include_an_object( be_a(String).and include("thing") ) }
|
55
|
+
it { is_expected.to include_an_object( be_a(String).and end_with("g") ) }
|
56
|
+
it { is_expected.to include_an_object( start_with("s").or include("y") ) }
|
57
|
+
it { is_expected.not_to include_an_object( start_with("b").or include("b") ) }
|
58
|
+
end
|
59
|
+
|
60
|
+
RSpec.describe ['anything', 'something'] do
|
61
|
+
it { is_expected.to include_an_object( be_a(Integer).and include("thing") ) }
|
62
|
+
it { is_expected.to include_an_object( be_a(Integer).and end_with("z") ) }
|
63
|
+
it { is_expected.to include_an_object( start_with("z").or include("1") ) }
|
64
|
+
it { is_expected.not_to include_an_object( start_with("a").or include("some") ) }
|
65
|
+
end
|
66
|
+
"""
|
67
|
+
When I run `rspec`
|
68
|
+
Then the output should contain all of these lines:
|
69
|
+
| 8 examples, 4 failures |
|
70
|
+
| expected ["anything", "something"] to include an object be a kind of Integer and include "thing" |
|
71
|
+
| expected ["anything", "something"] to include an object be a kind of Integer and end with "z" |
|
72
|
+
| expected ["anything", "something"] to include an object start with "z" or include "1" |
|
@@ -20,7 +20,7 @@ Feature: Check if a timeout occured during command execution
|
|
20
20
|
|
21
21
|
before(:each) { run('cli') }
|
22
22
|
|
23
|
-
it { expect(
|
23
|
+
it { expect(last_command_started).to run_too_long }
|
24
24
|
end
|
25
25
|
"""
|
26
26
|
When I run `rspec`
|
@@ -41,7 +41,7 @@ Feature: Check if a timeout occured during command execution
|
|
41
41
|
|
42
42
|
before(:each) { run('cli') }
|
43
43
|
|
44
|
-
it { expect(
|
44
|
+
it { expect(last_command_started).to have_finished_in_time }
|
45
45
|
end
|
46
46
|
"""
|
47
47
|
When I run `rspec`
|
data/features/output.feature
CHANGED
@@ -1,184 +1,47 @@
|
|
1
|
-
Feature:
|
1
|
+
Feature: All output of commands which were executed
|
2
2
|
|
3
3
|
In order to specify expected output
|
4
4
|
As a developer using Cucumber
|
5
5
|
I want to use the "the output should contain" step
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
Background:
|
8
|
+
Given I use a fixture named "cli-app"
|
9
|
+
|
10
|
+
Scenario: Detect output from all processes normal and interactive ones
|
11
|
+
Given an executable named "bin/cli1" with:
|
12
|
+
"""
|
13
|
+
#!/usr/bin/env bash
|
14
|
+
echo 'This is cli1'
|
15
|
+
"""
|
16
|
+
And an executable named "bin/cli2" with:
|
17
|
+
"""
|
18
|
+
#!/usr/bin/env ruby
|
19
|
+
|
20
|
+
while input = gets do
|
21
|
+
break if "" == input
|
22
|
+
puts input
|
23
|
+
end
|
24
|
+
"""
|
25
|
+
And a file named "features/output.feature" with:
|
26
|
+
"""
|
27
|
+
Feature: Run command
|
28
|
+
Scenario: Run command
|
29
|
+
When I run `cli1`
|
30
|
+
When I run `cli2` interactively
|
31
|
+
And I type "This is cli2"
|
32
|
+
And I type ""
|
33
|
+
Then the stdout should contain exactly:
|
34
|
+
\"\"\"
|
35
|
+
This is cli1
|
36
|
+
\"\"\"
|
37
|
+
And the stdout should contain exactly:
|
38
|
+
\"\"\"
|
39
|
+
This is cli2
|
40
|
+
\"\"\"
|
41
|
+
"""
|
42
|
+
When I run `cucumber`
|
43
|
+
Then the features should all pass
|
11
44
|
|
12
|
-
Scenario: Detect absence of one-line output
|
13
|
-
When I run `printf "hello world"`
|
14
|
-
Then the output should not contain "good-bye"
|
15
|
-
|
16
|
-
Scenario: Detect subset of multiline output
|
17
|
-
When I run `printf "hello\nworld"`
|
18
|
-
Then the output should contain:
|
19
|
-
"""
|
20
|
-
hello
|
21
|
-
"""
|
22
|
-
|
23
|
-
Scenario: Detect absence of multiline output
|
24
|
-
When I run `printf "hello\nworld"`
|
25
|
-
Then the output should not contain:
|
26
|
-
"""
|
27
|
-
good-bye
|
28
|
-
"""
|
29
|
-
|
30
|
-
@posix
|
31
|
-
Scenario: Detect exact one-line output
|
32
|
-
When I run `printf "hello world"`
|
33
|
-
Then the output should contain exactly:
|
34
|
-
"""
|
35
|
-
hello world
|
36
|
-
"""
|
37
|
-
|
38
|
-
@ansi
|
39
|
-
@posix
|
40
|
-
Scenario: Detect exact one-line output with ANSI output
|
41
|
-
When I run `printf "\e[36mhello world\e[0m"`
|
42
|
-
Then the output should contain exactly:
|
43
|
-
"""
|
44
|
-
\e[36mhello world\e[0m
|
45
|
-
"""
|
46
|
-
|
47
|
-
@posix
|
48
|
-
Scenario: Detect exact one-line output with ANSI output stripped by default
|
49
|
-
When I run `printf "\e[36mhello world\e[0m"`
|
50
|
-
Then the output should contain exactly:
|
51
|
-
"""
|
52
|
-
hello world
|
53
|
-
"""
|
54
|
-
|
55
|
-
@posix
|
56
|
-
Scenario: Detect exact multiline output
|
57
|
-
When I run `printf "hello\nworld"`
|
58
|
-
Then the output should contain exactly:
|
59
|
-
"""
|
60
|
-
hello
|
61
|
-
world
|
62
|
-
"""
|
63
|
-
|
64
|
-
@announce
|
65
|
-
Scenario: Detect subset of one-line output with regex
|
66
|
-
When I run `printf "hello, ruby"`
|
67
|
-
Then the output should contain "ruby"
|
68
|
-
And the output should match /^hello(, world)?/
|
69
|
-
|
70
|
-
@announce
|
71
|
-
@posix
|
72
|
-
Scenario: Detect subset of multiline output with regex
|
73
|
-
When I run `printf "hello\nworld\nextra line1\nextra line2\nimportant line"`
|
74
|
-
Then the output should match:
|
75
|
-
"""
|
76
|
-
he..o
|
77
|
-
wor.d
|
78
|
-
.*
|
79
|
-
important line
|
80
|
-
"""
|
81
|
-
|
82
|
-
@announce
|
83
|
-
Scenario: Negative matching of one-line output with regex
|
84
|
-
When I run `printf "hello, ruby"`
|
85
|
-
Then the output should contain "ruby"
|
86
|
-
And the output should not match /ruby is a better perl$/
|
87
|
-
|
88
|
-
@announce
|
89
|
-
@posix
|
90
|
-
Scenario: Negative matching of multiline output with regex
|
91
|
-
When I run `printf "hello\nworld\nextra line1\nextra line2\nimportant line"`
|
92
|
-
Then the output should not match:
|
93
|
-
"""
|
94
|
-
ruby
|
95
|
-
is
|
96
|
-
a
|
97
|
-
.*
|
98
|
-
perl
|
99
|
-
"""
|
100
|
-
|
101
|
-
@announce
|
102
|
-
@posix
|
103
|
-
Scenario: Match passing exit status and partial output
|
104
|
-
When I run `printf "hello\nworld"`
|
105
|
-
Then it should pass with:
|
106
|
-
"""
|
107
|
-
hello
|
108
|
-
"""
|
109
|
-
|
110
|
-
@posix
|
111
|
-
Scenario: Match passing exit status and exact output
|
112
|
-
When I run `printf "hello\nworld"`
|
113
|
-
Then it should pass with exactly:
|
114
|
-
"""
|
115
|
-
hello
|
116
|
-
world
|
117
|
-
"""
|
118
|
-
|
119
|
-
@announce-stdout
|
120
|
-
Scenario: Match failing exit status and partial output
|
121
|
-
When I run `bash -c '(printf "hello\nworld";exit 99)'`
|
122
|
-
Then it should fail with:
|
123
|
-
"""
|
124
|
-
hello
|
125
|
-
"""
|
126
|
-
|
127
|
-
@posix
|
128
|
-
Scenario: Match failing exit status and exact output
|
129
|
-
When I run `bash -c '(printf "hello\nworld";exit 99)'`
|
130
|
-
Then it should fail with exactly:
|
131
|
-
"""
|
132
|
-
hello
|
133
|
-
world
|
134
|
-
"""
|
135
|
-
|
136
|
-
@announce-stdout
|
137
|
-
@posix
|
138
|
-
Scenario: Match failing exit status and output with regex
|
139
|
-
When I run `bash -c '(printf "hello\nworld";exit 99)'`
|
140
|
-
Then it should fail with regex:
|
141
|
-
"""
|
142
|
-
hello\s*world
|
143
|
-
"""
|
144
|
-
|
145
|
-
@announce-cmd
|
146
|
-
@posix
|
147
|
-
Scenario: Match output in stdout
|
148
|
-
When I run `printf "hello\nworld"`
|
149
|
-
Then the stdout should contain "hello"
|
150
|
-
Then the stderr should not contain "hello"
|
151
|
-
|
152
|
-
@announce
|
153
|
-
Scenario: Match output on several lines
|
154
|
-
When I run `printf 'GET /'`
|
155
|
-
Then the stdout should contain:
|
156
|
-
"""
|
157
|
-
GET /
|
158
|
-
"""
|
159
|
-
|
160
|
-
@posix
|
161
|
-
Scenario: Match output on several lines using quotes
|
162
|
-
When I run `printf 'GET "/"'`
|
163
|
-
Then the stdout should contain:
|
164
|
-
"""
|
165
|
-
GET "/"
|
166
|
-
"""
|
167
|
-
|
168
|
-
@posix
|
169
|
-
Scenario: Detect output from all processes
|
170
|
-
When I run `printf "hello world!\n"`
|
171
|
-
And I run `cat` interactively
|
172
|
-
And I type "hola"
|
173
|
-
And I type ""
|
174
|
-
Then the output should contain exactly:
|
175
|
-
"""
|
176
|
-
hello world!
|
177
|
-
hola
|
178
|
-
|
179
|
-
"""
|
180
|
-
|
181
|
-
@posix
|
182
45
|
Scenario: Detect stdout from all processes
|
183
46
|
When I run `printf "hello world!\n"`
|
184
47
|
And I run `cat` interactively
|
@@ -187,22 +50,38 @@ Feature: Output
|
|
187
50
|
Then the stdout should contain:
|
188
51
|
"""
|
189
52
|
hello world!
|
53
|
+
"""
|
54
|
+
And the stdout should contain:
|
55
|
+
"""
|
190
56
|
hola
|
191
|
-
|
192
57
|
"""
|
193
58
|
And the stderr should not contain anything
|
194
59
|
|
195
|
-
@posix
|
196
60
|
Scenario: Detect stderr from all processes
|
197
61
|
When I run `bash -c 'printf "hello world!\n" >&2'`
|
198
62
|
And I run `bash -c 'cat >&2 '` interactively
|
199
63
|
And I type "hola"
|
200
64
|
And I type ""
|
201
65
|
Then the stderr should contain:
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
66
|
+
"""
|
67
|
+
hello world!
|
68
|
+
"""
|
69
|
+
And the stderr should contain:
|
70
|
+
"""
|
71
|
+
hola
|
72
|
+
"""
|
73
|
+
And the stdout should not contain anything
|
74
|
+
|
75
|
+
Scenario: Detect stderr from all processes (deprecated)
|
76
|
+
When I run `bash -c 'printf "hello world!\n" >&2'`
|
77
|
+
And I run `bash -c 'cat >&2 '` interactively
|
78
|
+
And I type "hola"
|
79
|
+
And I type ""
|
80
|
+
Then the stderr should contain:
|
81
|
+
"""
|
82
|
+
hello world!
|
83
|
+
hola
|
84
|
+
"""
|
206
85
|
And the stdout should not contain anything
|
207
86
|
|
208
87
|
Scenario: Detect output from named source
|