         , (toValue)->
             toValue * 2
         n.set 'k', 2
-        expect(m.get('k')).to.equal 1
-        expect(n.get('k')).to.equal 2
+        m.get('k').should.equal 1
+        n.get('k').should.equal 2
 
     it 'SetBindBackwards', ->
         m = new MVCObject()
         n = new MVCObject()
         n.set 'k', 1
         n.bindTo 'k', m
-        expect(m.get('k')).to.equal undefined
-        expect(n.get('k')).to.equal undefined
+        should.not.exist m.get 'k'
+        should.not.exist n.get 'k'
 
     it 'BindSetUnbind', ->
         m = new MVCObject()
         n = new MVCObject()
         n.bindTo 'k', m
         n.set 'k', 1
-        expect(m.get('k')).to.equal 1
-        expect(n.get('k')).to.equal 1
+        m.get('k').should.equal 1
+        n.get('k').should.equal 1
         n.unbind 'k'
-        expect(m.get('k')).to.equal 1
-        expect(n.get('k')).to.equal 1
+        m.get('k').should.equal 1
+        n.get('k').should.equal 1
         n.set 'k', 2
-        expect(m.get('k')).to.equal 1
-        expect(n.get('k')).to.equal 2
+        m.get('k').should.equal 1
+        n.get('k').should.equal 2
 
     it 'UnbindAll', ->
         m = new MVCObject()
         n = new MVCObject()
         n.bindTo 'k', m
         n.set 'k', 1
-        expect(m.get('k')).to.equal 1
-        expect(n.get('k')).to.equal 1
+        m.get('k').should.equal 1
+        n.get('k').should.equal 1
         n.unbindAll()
-        expect(m.get('k')).to.equal 1
-        expect(n.get('k')).to.equal 1
+        m.get('k').should.equal 1
+        n.get('k').should.equal 1
         n.set 'k', 2
-        expect(m.get('k')).to.equal 1
-        expect(n.get('k')).to.equal 2
+        m.get('k').should.equal 1
+        n.get('k').should.equal 2
 
     it 'BindNotify', ->
         m = new MVCObject()
         n = new MVCObject()
         m.bindTo 'k', n
-        mSpy = sinon.spy()
-        m.k_changed = mSpy
-        nSpy = sinon.spy()
-        n.k_changed = nSpy
-        n.set 'k', 1
-        expect(mSpy.calledOnce).to.be.ok
-        expect(nSpy.calledOnce).to.be.ok
+        m.k_changed = sinon.spy()
+        n.k_changed = sinon.spy()
+        n.set 'k', 1
+        m.k_changed.should.have.been.calledOnce
+        n.k_changed.should.have.been.calledOnce
 
     it 'BindBackwardsNotify', ->
         m = new MVCObject()
         n = new MVCObject()
         n.bindTo 'k', m
-        mSpy = sinon.spy()
-        m.k_changed = mSpy
-        nSpy = sinon.spy()
-        n.k_changed = nSpy
-        n.set 'k', 1
-        expect(mSpy.calledOnce).to.be.ok
-        expect(nSpy.calledOnce).to.be.ok
+        m.k_changed = sinon.spy()
+        n.k_changed = sinon.spy()
+        n.set 'k', 1
+        m.k_changed.should.have.been.calledOnce
+        n.k_changed.should.have.been.calledOnce
 
     it 'BindRename', ->
         m = new MVCObject()
         n = new MVCObject()
         n.bindTo 'kn', m, 'km'
         m.set 'km', 1
-        expect(m.get('km')).to.equal 1
-        expect(n.get('kn')).to.equal 1
+        m.get('km').should.equal 1
+        n.get('kn').should.equal 1
 
     it 'BindRenameCallbacks', ->
         m = new MVCObject()
         n = new MVCObject()
-        kmSpy = sinon.spy()
-        m.km_changed = kmSpy
-        knSpy = sinon.spy()
-        n.kn_changed = knSpy
+        m.km_changed = sinon.spy()
+        n.kn_changed = sinon.spy()
         n.bindTo 'kn', m, 'km'
         m.set 'km', 1
-        expect(m.get('km')).to.equal 1
-        expect(n.get('kn')).to.equal 1
-        expect(kmSpy.calledOnce).to.be.ok
-        expect(knSpy.calledTwice).to.be.ok
+        m.get('km').should.equal 1
+        n.get('kn').should.equal 1
+        m.km_changed.should.have.been.calledOnce
+        n.kn_changed.should.have.been.calledTwice
 
     it 'TransitiveBindForwards', ->
         m = new MVCObject()

describe 'MVCObject', ->
    it 'model', ->
        m = new MVCObject()
        expect(m).to.not.equal null
        expect(m).to.not.equal undefined

    it 'GetUndefined', ->
        m = new MVCObject()
        expect(m.get('k')).to.equal undefined

    it 'GetSetGet', ->
        m = new MVCObject()
        expect(m.get('k')).to.equal undefined
        m.set 'k', 1
        expect(m.get('k')).to.equal 1

    it 'SetValues', ->
        m = new MVCObject()
        m.setValues
            k1: 1
            k2: 2
        expect(m.get('k1')).to.equal 1
        expect(m.get('k2')).to.equal 2

    it 'NotifyCallback', ->
        m = new MVCObject()
        spy = sinon.spy()
        m.changed = spy
        m.notify 'k'
        expect(spy.calledOnce).to.be.ok

    it 'NotifyKeyCallback', ->
        m = new MVCObject()
        spy = sinon.spy()
        m.k_changed = spy
        m.notify 'k'
        expect(spy.calledOnce).to.be.ok

    # it 'NotifyKeyEvent', ->
    #     m = new MVCObject

    ###
    it 'Getter', ->
        a = new MVCObject()
        a.getX = sinon.spy()
        a.x = 2
        a.get('x').should.equal 2 # 直接返回self[key]
        a.getX.should.not.have.been.called # getterName 未被调用

    it 'GetterBind', ->
        a = new MVCObject()
        a.getX = ->
            1
        sinon.spy a, 'getX'
        b = new MVCObject()
        b.bindTo 'x', a
        b.get('x').should.equal 1
        a.getX.should.have.been.calledOnce

    it 'Priority', ->
        a = new MVCObject()
        b = new MVCObject()
        a.set 'k', 1
        b.set 'k', 2
        a.get('k').should.equal 1 # 未绑定之前
        b.get('k').should.equal 2
        a.bindTo 'k', b
        a.get('k').should.equal 2 # 绑定之后
        b.get('k').should.equal 2

    it 'PriorityUndefined', ->
        a = new MVCObject()
        b = new MVCObject()
        a.set 'k', 1
        a.get('k').should.equal 1 # 未绑定之前
        a.bindTo 'k', b
        should.not.exist a.get 'k' # 绑定之后
        should.not.exist b.get 'k'

    ###
        a --> b --> c
