Sha256: dee72d17cf3309bcb078c5befc14e1df4c6c27d7960d03156805d55fed31f634

Contents?: true

Size: 1.69 KB

Versions: 4

Compression:

Stored size: 1.69 KB

Contents

Feature: String constraints
  Scenario: Maximum length is short
    Given the following JSON schema:
      """json
      {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 2
          }
        }
      }
      """
    When I run the JSON data generator
    Then the output should match the schema

  Scenario: Minimum length is long
    Given the following JSON schema:
      """json
      {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 8
          }
        }
      }
      """
    When I run the JSON data generator
    Then the output should match the schema

  Scenario: Possible values given
    Given the following JSON schema:
      """json
      {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "foo",
              "bar",
              "baz"
            ]
          }
        }
      }
      """
    When I run the JSON data generator
    Then the output should match the schema

  Scenario: Date-time format
    Given the following JSON schema:
      """json
      {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
      """
      When I run the JSON data generator
      Then the output should match the schema

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
json_test_data-1.2.0 features/string_constraints.feature
json_test_data-1.1.3 features/string_constraints.feature
json_test_data-1.1.2 features/string_constraints.feature
json_test_data-1.1.1 features/string_constraints.feature