2017-11-02 07:05:11 -07:00

26 lines
1.4 KiB
YAML

desc: Stop people treating ptypes as objects
tests:
- cd: r.now()['epoch_time']
js: r.now()('epoch_time')
ot: err("ReqlQueryLogicError", "Cannot call `bracket` on objects of type `PTYPE<TIME>`.")
- cd: r.now().get_field('epoch_time')
ot: err("ReqlQueryLogicError", "Cannot call `get_field` on objects of type `PTYPE<TIME>`.")
- cd: r.now().keys()
ot: err("ReqlQueryLogicError", "Cannot call `keys` on objects of type `PTYPE<TIME>`.")
- cd: r.now().pluck('epoch_time')
ot: err("ReqlQueryLogicError", "Cannot call `pluck` on objects of type `PTYPE<TIME>`.")
- cd: r.now().without('epoch_time')
ot: err("ReqlQueryLogicError", "Cannot call `without` on objects of type `PTYPE<TIME>`.")
- cd: r.now().merge({"foo":4})
rb: r.now().merge({"foo"=>4})
ot: err("ReqlQueryLogicError", "Cannot call `merge` on objects of type `PTYPE<TIME>`.")
- cd: r.expr({"foo":4}).merge(r.now())
rb: r.expr({"foo"=>4}).merge(r.now())
ot: err("ReqlQueryLogicError", "Cannot merge objects of type `PTYPE<TIME>`.")
- cd: r.now().has_fields('epoch_time')
ot: err("ReqlQueryLogicError", "Cannot call `has_fields` on objects of type `PTYPE<TIME>`.")
- cd: r.object().has_fields(r.time(2014, 7, 7, 'Z'))
ot: err("ReqlQueryLogicError", "Invalid path argument `1404691200`.")
- cd: r.expr(1).keys()
ot: err("ReqlQueryLogicError", "Cannot call `keys` on objects of type `NUMBER`.")