elasticsearch/elasticsearch-js — pull request #128 by stormnode (2014-07-29 17:07:57+00:00)
Title: fix a bug in yaml_doc method do_match that was causing tests to pass that should have failed

If you change a value in the "create/10_with_id.yaml" the tests will still pass...

For example ---- go ahead and change the match _id to 10 from 1 and run the tests again, they still pass.

Obviously when you re-run the tests do not do the generation grunt task but simply run

grunt.registerTask('testmatch-nogeneration', [
'run:es_1.2',
'mochacov:integration_1.2',
'stop:es_1.2'
]);

Reason being if you look at the commit of this file from February 3, I believe that is when the bug could have been introduced...

https://github.com/stormtracks/elasticsearch-js/commit/f7f98572a3721bcbc65593f9aadc49181c4626bd

My fix allows the tests now to fail --- with the above scenario. Hope that committing to the master branch
is the right place to add this fix.

Also --- not one hundred percent sure my fix is exactly correct as I did not test the cases for

var isRef = _.isString(val) && val[0] === '$';
var isRE = _.isString(val) && val[0] === '/' && path[path.length - 1] === '/';

But only the default case else case when things fall through.

Please advise if more work needs to be done.

Thanks,
Michael Angerman
stormnode@gmail.com
Corvallis, Oregon