         properties:
           'an_integer': type: 'integer', 'minimum': 1
       handler: (->)
-    .catch (err) ->
-      err.message.should.eql 'data.an_integer should be >= 1'
+    .should.be.rejectedWith 'data.an_integer should be >= 1'
 
   it 'invalid with multiple errors', ->
-    nikita
-    .call
+    nikita.call
       a_string: 1
       an_integer: 0
       schema:

          properties:
            'split': $ref: 'registry://test/schema'
        handler: (->)
      .then ->
        throw Error 'Error not thrown as expected'
      .catch (err) ->
        err.message.should.eql 'data.split.an_integer should be integer'
  
  describe 'constructor', ->

    it 'useDefaults', ->
      nikita
      .call
        schema:
          type: 'object'
          properties:
            'a_string':
              type: 'string'
              default: 'a value'
      , ({options}) ->
        options.a_string.should.eql 'a value'

    it.skip 'coerceTypes', ->
      # Option is currently disactivated because it is unclear wether we shall
      # accept its rule or create ours. For exemple, `true` is cast to string `"true"`
      # and string `""` is cast to `null` which might not be what we want.
      nikita
      .call
        schema:
          type: 'object'
          properties:

        options:
          a_regexp: 'invalid'
        handler: (->)
      .should.be.rejectedWith 'data.a_regexp should pass "instanceof" keyword validation'
