 
   describe 'set', ->
 
+
     it 'should set a key with value', ->
       store.set 'hasCar', no
 

      expect(store.get('isDoctor')).not.toBeDefined()


  it 'should remove a key from store', ->
    expect(store.has('age')).toBeTruthy()
    expect(store.getKeys().length > 3).toBeTruthy()

    store.unset('age')

    expect(store.has('age')).toBeFalsy()
    expect(store.getKeys().length > 3).toBeFalsy()


  it 'should remove all keys from store', ->

    expect(values.length > 3).toBeTruthy()
    expect(values.indexOf('Fatih') > -1).toBeTruthy()
    expect(values.indexOf('32') is -1).toBeTruthy()


  describe 'validate', ->


    it 'should return true when the given data is valid', ->
      expect(store.validate 'firstName', 'acet').toBeTruthy()
      expect(store.validate 'lastName', 'Fatih').toBeTruthy()
      expect(store.validate 'email', 'fatih@fatihacet.com').toBeTruthy()
      expect(store.validate 'age', 29).toBeTruthy()
      expect(store.validate 'age', '12').toBeTruthy()
      expect(store.validate 'userId', '911ef212').toBeTruthy()
      expect(store.validate 'uniqueKey', 'unique').toBeTruthy()


    it 'should return false when the given data is invalid', ->
      expect(store.validate 'firstName', '').toBeFalsy()
      expect(store.validate 'firstName', 'f').toBeFalsy()
      expect(store.validate 'firstName', 'f4t1h4c3t').toBeFalsy()
      expect(store.validate 'firstName', 'thisisverylongfirstnameitshouldnotvalid').toBeFalsy()
      expect(store.validate 'firstName', 23).toBeFalsy()

      expect(store.validate 'lastName', '').toBeFalsy()
      expect(store.validate 'lastName', 'a').toBeFalsy()
      expect(store.validate 'lastName', 'thisisverylonglastnameitshouldnotvalid').toBeFalsy()
      expect(store.validate 'lastName', 42).toBeFalsy()

      expect(store.validate 'age', '').toBeFalsy()
      expect(store.validate 'age', {}).toBeFalsy()
      expect(store.validate 'age', 'fatih').toBeFalsy()

      expect(store.validate 'email', '12').toBeFalsy()
      expect(store.validate 'email', 'fatih').toBeFalsy()
      expect(store.validate 'email', 'fatih@fatihacet').toBeFalsy()
      expect(store.validate 'email', '').toBeFalsy()

      expect(store.validate 'userId', '12').toBeFalsy()
      expect(store.validate 'userId', 'fatih').toBeFalsy()
      expect(store.validate 'userId', 123123123123).toBeFalsy()
      expect(store.validate 'userId', '').toBeFalsy()

      expect(store.validate 'uniqueKey', 'notUnique').toBeFalsy()
      expect(store.validate 'uniqueKey', 'notValid').toBeFalsy()


    it 'should assume the value is valid if there is not validation rule for it', ->
      expect(store.validate 'notExistKey', 'itdoesnotmatter').toBeTruthy()


    it 'should throw error when no validator found', ->
      error   = new Error 'Validation type foo does not exist.'
      options = validations: name: foo:  yes
      data    = name: 'Acetz'
      store   = new spark.core.Store options, data

      expect( -> store.validate('name', 'fatih')).toThrow error
