This repository has been archived by the owner on Mar 1, 2019. It is now read-only.
forked from cucumber/aruba
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinteractive.feature
90 lines (80 loc) · 2.58 KB
/
interactive.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Feature: Running an interactive command
In order to test interactive command line applications
As a developer using Cucumber
I want to use the interactive session steps
Background:
Given I use a fixture named "cli-app"
@wip-jruby-java-1.6
Scenario: Running ruby interactively
Given an executable named "bin/aruba-test-cli" with:
"""bash
#!/usr/bin/env ruby
while res = gets.chomp
break if res == "quit"
puts res.reverse
end
"""
And a file named "features/interactive.feature" with:
"""cucumber
Feature: Run command
Scenario: Run command
When I run `cli` interactively
And I type "hello, world"
And I type "quit"
Then it should pass with "dlrow ,olleh"
"""
When I run `cucumber`
Then the features should all pass
@posix
Scenario: Running a native binary interactively
Given a file named "features/interactive.feature" with:
"""cucumber
Feature: Run command
Scenario: Run command
When I run `cat` interactively
And I type "Hello, world"
And I type ""
Then the output should contain "Hello, world"
"""
When I run `cucumber`
Then the features should all pass
@posix
Scenario: Pipe in a file
Given a file named "features/interactive.feature" with:
"""cucumber
Feature: Run command
Scenario: Run command
Given a file named "test.txt" with "line1\nline2"
When I run `cat` interactively
And I pipe in the file "test.txt"
Then the output should contain "line1\nline2"
"""
When I run `cucumber`
Then the features should all pass
@posix
Scenario: Close stdin stream
Given a file named "features/interactive.feature" with:
"""cucumber
Feature: Run command
Scenario: Run command
When I run `cat` interactively
And I type "Hello, world"
And I close the stdin stream
Then the output should contain "Hello, world"
"""
When I run `cucumber`
Then the features should all pass
@posix
Scenario: All processes are stopped before checking for filesystem changes
See: http://github.com/aslakhellesoy/aruba/issues#issue/17 for context
Given a file named "features/interactive.feature" with:
"""cucumber
Feature: Run command
Scenario: Run command
Given a directory named "rename_me"
When I run `mv rename_me renamed` interactively
Then the directory "renamed" should exist
And the directory "rename_me" should not exist
"""
When I run `cucumber`
Then the features should all pass