forked from cucumber/aruba
-
Notifications
You must be signed in to change notification settings - Fork 2
/
use_fixture.feature
77 lines (70 loc) · 2.6 KB
/
use_fixture.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
Feature: Use a fixture
As a user of aruba
I want to use a fixture
Background:
Given I use a fixture named "cli-app"
Scenario: Use the fixture if fixtures directory is in root directory
Given a file named "features/use_fixtures.feature" with:
"""
Feature: Use Fixture
Scenario: Use Fixture
Given I use a fixture named "my-app"
Then a file named "MY-APP-README.md" should exist
"""
And a directory named "fixtures"
And a directory named "fixtures/my-app"
And an empty file named "fixtures/my-app/MY-APP-README.md"
When I run `cucumber`
Then the features should all pass
Scenario: Use the fixture if fixtures directory is in features-directory
Given a file named "features/use_fixtures.feature" with:
"""
Feature: Use Fixture
Scenario: Use Fixture
Given I use a fixture named "my-app"
Then a file named "MY-APP-README.md" should exist
"""
And a directory named "features/fixtures"
And a directory named "features/fixtures/my-app"
And an empty file named "features/fixtures/my-app/MY-APP-README.md"
When I run `cucumber`
Then the features should all pass
Scenario: Use the fixture if fixtures directory is in spec-directory
Given a file named "features/use_fixtures.feature" with:
"""
Feature: Use Fixture
Scenario: Use Fixture
Given I use a fixture named "my-app"
Then a file named "MY-APP-README.md" should exist
"""
And a directory named "spec/fixtures"
And a directory named "spec/fixtures/my-app"
And an empty file named "spec/fixtures/my-app/MY-APP-README.md"
When I run `cucumber`
Then the features should all pass
Scenario: Use the fixture if fixtures directory is in test-directory
Given a file named "features/use_fixtures.feature" with:
"""
Feature: Use Fixture
Scenario: Use Fixture
Given I use a fixture named "my-app"
Then a file named "MY-APP-README.md" should exist
"""
And a directory named "test/fixtures"
And a directory named "test/fixtures/my-app"
And an empty file named "test/fixtures/my-app/MY-APP-README.md"
When I run `cucumber`
Then the features should all pass
Scenario: Fails if fixture does not exist
Given a file named "features/use_fixtures.feature" with:
"""
Feature: Use Fixture
Scenario: Use Fixture
Given I use a fixture named "my-app"
"""
And a directory named "fixtures"
When I run `cucumber`
Then the features should not all pass with regex:
"""
Fixture "my-app" does not exist in fixtures directory ".+/fixtures"
"""