File: use_fixture.feature

package info (click to toggle)
ruby-aruba 0.14.8-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,216 kB
  • sloc: ruby: 7,951; sh: 21; makefile: 12
file content (77 lines) | stat: -rw-r--r-- 2,666 bytes parent folder | download | duplicates (5)
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"
    """