Sha256: 2ff73cc5642acd9b32cb1a3715fe1eb0961d23ca1e5eee96596dd9af43743fa1

Contents?: true

Size: 1.58 KB

Versions: 4

Compression:

Stored size: 1.58 KB

Contents

Feature: Core schema: default

  Scenario: validation succeeds because of default
    When the schema is:
      """
      {
          "properties": {
              "name": {
                  "type": "string",
                  "required": true
              }
          },

          "default": {
              "name": "Gristle Thornbody"
          }
      }
      """
      Then '{ "age": 35 }' is valid JSON

  Scenario: validation fails because of default
    When the schema is:
      """
      {
          "properties": {
              "name": {
                  "type": "string"
              }
          },

          "default": {
              "name": 1999
          }
      }
      """
    Then '{ "age": 35 }' is not valid JSON

  Scenario: validation of property succeeds because of default
    When the schema is:
      """
      {
          "properties": {
              "pi": {
                  "type": "number",
                  "required": true,
                  "default": 3.1415
              }
          }
      }
      """
    Then '{ "somethingElse": "foo" }' is valid JSON
    But '{ "pi": "is delicious" }' is not valid JSON

  Scenario: validation of property fails because of default
    When the schema is:
      """
      {
          "properties": {
              "pi": {
                  "type": "number",
                  "required": true,
                  "default": "is delicious"
              }
          }
      }
      """
    Then '{ "somethingElse": "foo" }' is not valid JSON
    But '{ "pi": 3.1415 }' is valid JSON

  Scenario: default for all types
    TODO: spec

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
jschematic-0.0.9 features/default.feature
jschematic-0.0.6 features/default.feature
jschematic-0.0.5 features/default.feature
jschematic-0.0.2 features/default.feature