File: inclusion.feature

package info (click to toggle)
ruby-json-spec 1.1.5-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 312 kB
  • sloc: ruby: 1,059; makefile: 2
file content (154 lines) | stat: -rw-r--r-- 3,264 bytes parent folder | download | duplicates (4)
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
Feature: Inclusion
  Background:
    Given the JSON is:
      """
      {
        "array": [
          "json",
          "spec"
        ],
        "created_at": "2011-07-08 02:27:34",
        "empty_array": [

        ],
        "empty_hash": {
        },
        "false": false,
        "float": 10.0,
        "hash": {
          "json": "spec"
        },
        "id": 1,
        "integer": 10,
        "negative": -10,
        "null": null,
        "string": "json_spec",
        "true": true,
        "updated_at": "2011-07-08 02:28:50",
        "nested": {
          "id": 2,
          "key": "value"
        }
      }
      """

  Scenario: String
    When I get the JSON
    Then the JSON should include "json_spec"
    And the JSON should include:
      """
      "json_spec"
      """

  Scenario: Integer
    When I get the JSON
    Then the JSON should include 10
    And the JSON should include:
      """
      10
      """

  Scenario: Negative integer
    When I get the JSON
    Then the JSON should include -10
    And the JSON should include:
      """
      -10
      """

  Scenario: Float
    When I get the JSON
    Then the JSON should include 10.0
    And the JSON should include 10.0e0
    And the JSON should include 10.0e+0
    And the JSON should include 10.0e-0
    And the JSON should include 10e0
    And the JSON should include 10e+0
    And the JSON should include 10e-0
    And the JSON should include 1.0e1
    And the JSON should include 1.0e+1
    And the JSON should include 1e1
    And the JSON should include 1e+1
    And the JSON should include 100.0e-1
    And the JSON should include 100e-1
    And the JSON should include:
      """
      10.0
      """

  Scenario: Array
    When I get the JSON
    Then the JSON should include ["json","spec"]
    And the JSON at "array" should include "json"
    And the JSON at "array" should include "spec"
    And the JSON should include:
      """
      [
        "json",
        "spec"
      ]
      """

  Scenario: Empty array
    When I get the JSON
    Then the JSON should include []
    And the JSON should include:
      """
      [

      ]
      """

  Scenario: Hash
    When I get the JSON
    Then the JSON should include {"json":"spec"}
    And the JSON at "hash" should include "spec"
    And the JSON should include:
      """
      {
        "json": "spec"
      }
      """

  Scenario: Empty hash
    When I get the JSON
    Then the JSON should include {}
    And the JSON should include:
      """
      {
      }
      """

  Scenario: True
    When I get the JSON
    Then the JSON should include true
    And the JSON should include:
      """
      true
      """

  Scenario: False
    When I get the JSON
    Then the JSON should include false
    And the JSON should include:
      """
      false
      """

  Scenario: Null
    When I get the JSON
    Then the JSON should include null
    And the JSON should include:
      """
      null
      """

  Scenario: Excluded value
    When I get the JSON
    Then the JSON should include "2011-07-08 02:27:34"
    And the JSON should include 1
    And the JSON should include "2011-07-08 02:28:50"

  Scenario: Nested exclusions
    When I get the JSON
    Then the JSON should include {"key":"value"}