imbo / behat-api-extension

API extension for Behat, used to ease testing of JSON-based APIs
MIT License
109 stars 42 forks source link

Custom functions for greater than and less than for numeric values #43

Closed christeredvartsen closed 7 years ago

christeredvartsen commented 7 years ago

The extension should have custom matcher functions for doing greater than and less than with regards to numeric values. The functions could be called @gt and @lt, and could be used like this:

Response

{
  "value": 123,
  "some other value": 456
}

Step

Then the response body contains JSON:
    """
    {
      "value": "@gt(100)",
      "some other value": "@lt(500)"
    }
    """
christeredvartsen commented 7 years ago

Resolved by ba9cc350aee0aa4e0ebb29980d34e6eae90e796a.