desc: Tests deletes of selections
tests:

    # Set up some data
    - cd: r.db('test').table_create('test1')
      ot: ({'created':1})

    - def: tbl = r.db('test').table('test1')

    - cd: r.db('test').table_create('test2')
      ot: ({'created':1})

    - def: tbl2 = r.db('test').table('test2')

    - py: tbl.insert([{'id':i} for i in xrange(100)])
      js: |
        tbl.insert(function(){
            var res = []
            for (var i = 0; i < 100; i++) {
                res.push({id: i});
            }
            return res;
        }())
      rb: tbl.insert((1..100).map{ |i| {"id" => i} })
      ot: ({'deleted':0.0,'replaced':0.0,'unchanged':0.0,'errors':0.0,'skipped':0.0,'inserted':100})

    - cd: tbl.count()
      ot: 100

    # Point delete

    - cd: tbl.get(12).delete()
      ot: ({'deleted':1,'replaced':0.0,'unchanged':0.0,'errors':0.0,'skipped':0.0,'inserted':0.0})

    # Attempt deletion with bad durability flag.

    - js: tbl.skip(50).delete({durability:'wrong'})
      rb: tbl.skip(50).delete({ :durability => 'wrong' })
      py: tbl.skip(50).delete(durability='wrong')
      ot: err('RqlRuntimeError', 'Durability option `wrong` unrecognized (options are "hard" and "soft").', [0])

    # Delete selection of table, soft durability flag.

    - js: tbl.skip(50).delete({durability:'soft'})
      rb: tbl.skip(50).delete({ :durability => 'soft' })
      py: tbl.skip(50).delete(durability='soft')
      ot: ({'deleted':49,'replaced':0.0,'unchanged':0.0,'errors':0.0,'skipped':0.0,'inserted':0.0})

    # Delete whole table, hard durability flag.

    - js: tbl.delete({durability:'hard'})
      rb: tbl.delete({ :durability => 'hard' })
      py: tbl.delete(durability='hard')
      ot: ({'deleted':50,'replaced':0.0,'unchanged':0.0,'errors':0.0,'skipped':0.0,'inserted':0.0})

    # clean up
    - cd: r.db('test').table_drop('test1')
      ot: "({'dropped':1})"
    - cd: r.db('test').table_drop('test2')
      ot: "({'dropped':1})"

    # test deletion on a non-deletable object
    - cd: r.expr([1, 2]).delete()
      ot: err('RqlRuntimeError', 'Expected type SELECTION but found DATUM.', [0])
