 
   it 'not delete space after word when selection ends at last character', ->
     rte1 = new Rte "I am yjs here!"
-    sel = new Selection(5, 8, rte1)
+    sel = new Selection({word:2, pos:0}, {word:2, pos:3})
     rte1.deleteSel(sel)
     rte1.val().should.equal "I am  here!"
 


describe 'Selection object should', ->
  sel = rte = null

  it 'be initialized with three parameters', ->
    rte = new Rte "Zero One two three four five"
    sel = new Selection 0, 1, rte

    sel.should.have.property('startPos')
    sel.should.have.deep.property('startPos.word', 0)
    sel.should.have.deep.property('startPos.pos', 0)

    sel.should.have.property('endPos')
    sel.should.have.deep.property('endPos.word', 1)
    sel.should.have.deep.property('endPos.pos', 2)


    rte1 = new Rte "There is a mistake in this sentence! there"
    rte1.deleteWords(7, 8)
    rte1.val().should.equal "There is a mistake in this sentence! "

  it 'insert characters correctly at relative positions', ->
    rte1 = new Rte "I lot the gam"
    rte1.insert({startPos: {word:1, pos:2}}, 's')
    rte1.val().should.equal "I lost the gam"
