{"_id":"rope","_rev":"35-d825d42632cf0b437ac2babf99f5372f","name":"rope","description":"test harness for minq queries","dist-tags":{"latest":"1.0.1-pre"},"versions":{"0.0.1":{"name":"rope","version":"0.0.1","description":"test harness for minq queries","main":"index.js","scripts":{"test":"node node_modules/mocha/bin/mocha"},"repository":{"type":"git","url":"git@github.com:jden/rope.git"},"author":{"name":"jden"},"license":"MIT","dependencies":{"q":"~0.9.2","lodash":"~1.1.0"},"devDependencies":{"chai":"~1.5.0","mocha":"~1.8.2"},"stability":"experimental","_id":"rope@0.0.1","dist":{"shasum":"f9d7b4eb5446cd4af1c57029cd9a715c1b98a695","tarball":"https://registry.npmjs.org/rope/-/rope-0.0.1.tgz","integrity":"sha512-F2rLbsNYAIXdJj82wR/ahlrxkAEdgPrtuZvZ19HonFrGXKv5lejC429Vhs8JcxxvvIAjz8u4d0jpCjKJhqskQg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICPgEyAIyMLiSTOcZTf1nlj6RH6oUyx/DNNurzWad8PKAiEApF0GrRKJMuSNeQux4AsY/UIlwzdoeghYViV+rb+vqs4="}]},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"jden","email":"jason@denizac.org"},"maintainers":[{"name":"jden","email":"jason@denizac.org"}],"directories":{}},"0.1.0":{"name":"rope","version":"0.1.0","description":"test harness for minq queries","main":"index.js","scripts":{"test":"node node_modules/mocha/bin/mocha"},"repository":{"type":"git","url":"git@github.com:jden/rope.git"},"author":{"name":"jden"},"license":"MIT","dependencies":{"q":"~0.9.2","lodash":"~1.1.0","objectid":"~2.3.0","functioncreate":"~0.1.0"},"devDependencies":{"chai":"~1.5.0","mocha":"~1.8.2"},"stability":"experimental","_id":"rope@0.1.0","dist":{"shasum":"63043920c49d48e94529fe8c9d379820269223eb","tarball":"https://registry.npmjs.org/rope/-/rope-0.1.0.tgz","integrity":"sha512-jVrYSB9OpPIShfRZ2Pu+3CHbIfaDHAdBBD80uIcBo/+O3fyEDFiajH0wRTMfV5T/GwTMR002/rqZrrtxD0wPeQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBD/1RH8P0nY/Qat16HubmSfPkX1iSXSc/CSZKQL7paTAiEA0lA2vZNXY3l8J3IsMPHaXMShpxY+twurmZa3FMqBlO4="}]},"_npmVersion":"1.2.0","_npmUser":{"name":"jden","email":"jason@denizac.org"},"maintainers":[{"name":"jden","email":"jason@denizac.org"}],"directories":{}},"0.2.0":{"name":"rope","version":"0.2.0","description":"test harness for minq queries","main":"index.js","scripts":{"test":"node node_modules/mocha/bin/mocha"},"repository":{"type":"git","url":"git@github.com:jden/rope.git"},"author":{"name":"jden"},"license":"MIT","dependencies":{"q":"~0.9.2","lodash":"~1.1.0","objectid":"~2.3.0","functioncreate":"~0.1.0"},"devDependencies":{"chai":"~1.5.0","mocha":"~1.8.2"},"stability":"experimental","_id":"rope@0.2.0","dist":{"shasum":"5ba14e73636369437bd94195e8ac05a2689ae2a8","tarball":"https://registry.npmjs.org/rope/-/rope-0.2.0.tgz","integrity":"sha512-yydRxEbzE9QqXVqWN4/A4Q/CveI0u0BzAfzgQbTYgUuYH9mD342Ametq4geYNFYCLUOJaP0QDnHYnabPiTzVwA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDV4KEXIPSjP3xNgRVq5+G/2nwsltHnTZnoG0ldkkvYVAiEA+Qb6AMhFcIAK1953vgUu9r68drmEQI7jw+JyWPy3M30="}]},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"jden","email":"jason@denizac.org"},"maintainers":[{"name":"jden","email":"jason@denizac.org"}],"directories":{}},"0.3.0":{"name":"rope","version":"0.3.0","description":"test harness for minq queries","main":"index.js","scripts":{"test":"node node_modules/mocha/bin/mocha"},"repository":{"type":"git","url":"git@github.com:jden/rope.git"},"author":{"name":"jden"},"license":"MIT","dependencies":{"q":"~0.9.2","lodash":"~1.1.0","objectid":"~2.3.0","functioncreate":"~0.1.0"},"devDependencies":{"chai":"~1.5.0","mocha":"~1.8.2"},"stability":"experimental","_id":"rope@0.3.0","dist":{"shasum":"542c6e4e7aef53bbfbefff46eba573530848e55f","tarball":"https://registry.npmjs.org/rope/-/rope-0.3.0.tgz","integrity":"sha512-wVu/VzDhbNOdYl+/wjEBBR4bw3T+YaWHfae0kN7bohoRX8ZQ+gr3we/Z0wHDgqK79F8xuS0+Uovg2q+P6KrK6g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8fRrj+45IXW+6mnE1Xp/EO6n78MqReXoi06rLOZSmmwIhAL9WApppUEWe6x8Br4H7Qk7WmCfdEfsduJNNtl3kZHCN"}]},"_npmVersion":"1.2.0","_npmUser":{"name":"jden","email":"jason@denizac.org"},"maintainers":[{"name":"jden","email":"jason@denizac.org"}],"directories":{}},"0.4.0":{"name":"rope","version":"0.4.0","description":"test harness for minq queries","main":"index.js","scripts":{"test":"node node_modules/mocha/bin/mocha"},"repository":{"type":"git","url":"git@github.com:jden/rope.git"},"author":{"name":"jden"},"license":"MIT","dependencies":{"q":"~0.9.2","lodash":"~1.1.0","objectid":"~2.3.0","functioncreate":"~0.1.0"},"devDependencies":{"chai":"~1.5.0","mocha":"~1.8.2"},"stability":"experimental","_id":"rope@0.4.0","dist":{"shasum":"1b96cbfecef165f80df21a2dd80cc6c41c9d636b","tarball":"https://registry.npmjs.org/rope/-/rope-0.4.0.tgz","integrity":"sha512-vGnHms4HLbdvOJw90veRRfNKLNVsLkGDppj6d4I9BN+VEMe5s/hdzaGGb9xc8IpdRYhyVOZxNXpHJJf5KhupJw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICZrSGH8nt4ayNzKq8uzoW4Kt88rD8fZikldGmpBQHLzAiB8K0EsOg6jFTfvSgJLne4oiGto/DGlQBa8+4Mtua6FIQ=="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"jden","email":"jason@denizac.org"},"maintainers":[{"name":"jden","email":"jason@denizac.org"}],"directories":{}},"0.4.1":{"name":"rope","version":"0.4.1","description":"test harness for minq queries","main":"index.js","scripts":{"test":"node node_modules/mocha/bin/mocha"},"repository":{"type":"git","url":"git@github.com:jden/rope.git"},"author":{"name":"jden"},"license":"MIT","dependencies":{"q":"~0.9.2","lodash":"~1.1.0","objectid":"~3.0.1","functioncreate":"~0.1.0"},"devDependencies":{"chai":"~1.5.0","mocha":"~1.8.2"},"stability":"experimental","_id":"rope@0.4.1","dist":{"shasum":"154fd3d427ccc3837df087c7563b28f45fab50b3","tarball":"https://registry.npmjs.org/rope/-/rope-0.4.1.tgz","integrity":"sha512-XQb8Bg3P0wq+kmOOVdcoGMndBk9gey4d5ByTa+jZDCN/xz3r0Vnrfx6f7rhVxwvhT7ml7d5MqIxwJuCPOdKX0Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHJ4Xa8fMBFZC/mYPWgcGAkLG1cyJQxUZg0XI890ThevAiABKCcHc2HqHAj1BEepc6gMoxdbVKYt/MejberOWJlnrg=="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"jden","email":"jason@denizac.org"},"maintainers":[{"name":"jden","email":"jason@denizac.org"}],"directories":{}},"0.5.0":{"name":"rope","version":"0.5.0","description":"test harness for minq queries","main":"index.js","scripts":{"test":"node node_modules/mocha/bin/mocha"},"repository":{"type":"git","url":"git@github.com:jden/rope.git"},"author":{"name":"jden"},"license":"MIT","dependencies":{"q":"~0.9.2","lodash":"~1.1.0","objectid":"~3.0.1","functioncreate":"~0.1.0"},"devDependencies":{"chai":"~1.5.0","mocha":"~1.8.2"},"stability":"experimental","bugs":{"url":"https://github.com/jden/rope/issues"},"_id":"rope@0.5.0","dist":{"shasum":"9b763161afd0677c136820f3fd76775185801db7","tarball":"https://registry.npmjs.org/rope/-/rope-0.5.0.tgz","integrity":"sha512-sKOiCxfIeAz8U8uUj6lV0BOT2x2qtPtpYbJhIEJIM3ZUb+iWx9MLInodvlRDjyL6x/q52Fg8+c7Q8Cglb1iuWg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDs/p0Peq4DOxNDuKRPri2O5vkXFZoN7x+a0kDhDVrTmwIgM+0bHZvTAiEdfPb9sZM83/cFeEiLYKz33V6GZR57bJA="}]},"_from":".","_npmVersion":"1.2.30","_npmUser":{"name":"jden","email":"jason@denizac.org"},"maintainers":[{"name":"jden","email":"jason@denizac.org"}],"directories":{}},"0.5.1":{"name":"rope","version":"0.5.1","description":"test harness for minq queries","main":"index.js","scripts":{"test":"node node_modules/mocha/bin/mocha"},"repository":{"type":"git","url":"git@github.com:jden/rope.git"},"author":{"name":"jden"},"license":"MIT","dependencies":{"q":"~0.9.2","lodash":"~1.1.0","objectid":"~3.0.1","functioncreate":"~0.1.0"},"devDependencies":{"chai":"~1.5.0","mocha":"~1.8.2"},"stability":"experimental","bugs":{"url":"https://github.com/jden/rope/issues"},"_id":"rope@0.5.1","dist":{"shasum":"e14cf0de1099f2d5d78c6608378e8863f1c5bfe3","tarball":"https://registry.npmjs.org/rope/-/rope-0.5.1.tgz","integrity":"sha512-pRsAggcf1S0nmT4mFV8fvSbJ5HafY30DPbDcHRYAl1JWqbfaQvcEn4DANj/Pq83lwWSXK4Q7GgA5UFmk0NumFA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID5B/GUSIxue/r24BoziV01lUtpk0wp2QuoIccxAmZjFAiEAj7HQ3Zpjvznrr+Djz2uEmEhA+0j0sX8N1xUttZXDgJU="}]},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"jden","email":"jason@denizac.org"},"maintainers":[{"name":"jden","email":"jason@denizac.org"}],"directories":{}},"1.0.0-pre":{"name":"rope","version":"1.0.0-pre","description":"test harness for minq queries","main":"index.js","scripts":{"test":"node node_modules/mocha/bin/mocha"},"repository":{"type":"git","url":"git@github.com:jden/rope.git"},"author":{"name":"jden"},"license":"MIT","dependencies":{"q":"~0.9.2","lodash":"~1.1.0","objectid":"~3.0.1","functioncreate":"~0.1.0"},"devDependencies":{"chai":"~1.5.0","mocha":"~1.8.2"},"stability":"experimental","bugs":{"url":"https://github.com/jden/rope/issues"},"homepage":"https://github.com/jden/rope","_id":"rope@1.0.0-pre","dist":{"shasum":"fb7cd87e6b74b0b750568b6982f1fcab5eebefa9","tarball":"https://registry.npmjs.org/rope/-/rope-1.0.0-pre.tgz","integrity":"sha512-DWetc9tFYZc3JvsdWzSQYHEApOVoHJTPvB2D/6Hqj8tfuZp2qaZ+wmLri1ETMe+ggWcl1PslW6dhq7tBz9y+VQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCEu7l+pRTgQPjekrbloXRNrLXRYYEVXpIdhahDXY26QgIgWdhuIfcCrhLpvdGrgFE2EmgDYD8APm8ZzN8eNypWXoY="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"jden","email":"jason@denizac.org"},"maintainers":[{"name":"jden","email":"jason@denizac.org"}],"directories":{}},"1.0.1-pre":{"name":"rope","version":"1.0.1-pre","description":"test harness for minq queries","main":"index.js","scripts":{"test":"node node_modules/mocha/bin/mocha"},"repository":{"type":"git","url":"git@github.com:jden/rope.git"},"author":{"name":"jden"},"license":"MIT","dependencies":{"lodash":"~1.1.0","objectid":"~3.0.1","functioncreate":"~0.1.0","bluebird":"~0.11.5-0"},"devDependencies":{"chai":"~1.5.0","mocha":"~1.8.2"},"stability":"experimental","bugs":{"url":"https://github.com/jden/rope/issues"},"homepage":"https://github.com/jden/rope","_id":"rope@1.0.1-pre","dist":{"shasum":"800e5b901f1e4fc9d1d0f0cb305ac75d482beb5b","tarball":"https://registry.npmjs.org/rope/-/rope-1.0.1-pre.tgz","integrity":"sha512-jRxwKG28DdCjdJiyN4knEe4i22honrqlq9AI+XHnGv+CxeyvKuRlvmKaSRuFP538FEHD7MZh9LC1rq3QfYIyeQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDi8il4U6h6eGoh+zaOJug3S9A9RgVotwU6o1lPzxvTQQIhAK6sy8sZOby7CeozuAgbcYf8touyJw+tD1b3Mbq5411I"}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"jden","email":"jason@denizac.org"},"maintainers":[{"name":"jden","email":"jason@denizac.org"}],"directories":{}}},"readme":"# rope\ntest harness for [minq](https://npm.im/minq) queries\n\n1.0.x of `rope` targets 1.0.x of `minq`\n\ntest all the things!\n\nAccording to [The complete mink harness video](http://www.youtube.com/watch?v=eidzxk8HaxY), the best kind of rope to use is nylon.\n\n## Stability\n\nExperimental: Expect the unexpected. Please provide feedback on api and your use-case.\n\n## installation\n\n    $ npm install rope\n\n## example usage\n\na [mocha](https://npm.im/mocha)-style test given:\n\n`foo.js`:\n\n    var minq = require('minq')\n\n    module.exports = function () {\n      return minq(process.env.DB).from('foos').toArray().then(function (foos) {\n        // sure, we could have used a regex, but imagine more complicated application-level logic that you want to test against known database values\n        return foos.filter(function (foo) { return foo.name.length > 3 })\n      })\n    }\n\n`test-foo.js`:\n\n    var rope = require('rope')\n    var moquire = require('moquire')\n    var chai = require('chai')\n    chai.should()\n\n    describe('foo', function () {\n      it('returns names longer than 3 letters', function (done) {\n\n        var spy = rope().stub({\n           data: [\n            {name: 'Al'},\n            {name: 'Sue'},\n            {name: 'Xerxes'}] \n          })\n        var foo = moquire('foo', {minq: spy})\n\n        foo().then(function (result) {\n          result.should.deep.equal({name: 'Xerxes'})\n        }).then(done, done)\n\n      })\n    })\n\n## usage\n\n### `rope() => MinqFakeBuilder`\n\nConstructor function. Returns a new MinqTestBuilder object.\n\n### `MinqFakeBuilder#stub(config) => MinqFakeBuilder`\n\nChainable. Set up return values for queries. `config` is an object with these properties:\n\n  - `data`: (required) The return value. Depending on the expected cardinality of the query (eg, `minq#one` vs `minq#toArray`), this should be an Array or a scalar Object.\n  - `collection`: The expected collection of the query.\n  - `where`: The expected conditional clause of the query.\n\n### `MinqFakeBuilder#minq() => MinqFake`\n\nReturns an object with the same interface as `minq`. Use this object in place of requiring `minq` in your functions under test.\n\n## Stub dispatch\n\nWhen a single test is expecting multiple queries, you can distinguish return values by collection. For example, to test this:\n  \n    function foo(userId) {\n      return minq.from('users')\n      .byId(userId)\n      .select({country: 1})\n      .one()\n      .then(function (user) {\n        return minq.from('countries')\n          .byId(user.country)\n          .one()\n      })\n    }\n\nyou could do:\n\n    minq = rope()\n      .stub({collection: 'users', data: {country: 12}})\n      .stub({collection: 'countries', data: {name: 'Uganda'}})\n      .minq()\n\n    foo('user2').then(function (val) {\n      val.should.deep.equal({name: 'Uganda'})\n\n      minq.queries[0].query.should.deep.equal({_id: 'user2'})\n      minq.queries[1].query.should.deep.equal({_id: 'user2'})\n    })\n\nNote that real `minq#byId` and `minq#byIds` coerce the values to BSON ObjectIds\n\nThis is likely to be refined in future versions.\n\n## Bonus knowledge\n\nMinks are of the family Mustelidae, which also includes the weasels, otters and ferrets.\n\nYou may also be interested in [how to put a harness on a tame mink](http://www.youtube.com/watch?v=fHbfzWQ4ksI)\n\n## License\nMIT. (c) 2013 jden <jason@denizac.org>. See LICENSE.md","maintainers":[],"time":{"modified":"2022-06-26T14:11:48.308Z","created":"2013-03-27T08:21:26.544Z","0.0.1":"2013-03-27T08:21:40.911Z","0.1.0":"2013-03-28T01:36:32.713Z","0.2.0":"2013-04-04T05:21:24.772Z","0.3.0":"2013-04-18T20:27:41.677Z","0.4.0":"2013-05-14T21:41:01.429Z","0.4.1":"2013-05-14T21:48:44.211Z","0.5.0":"2013-07-17T05:23:24.389Z","0.5.1":"2013-08-03T01:03:29.436Z","1.0.0-pre":"2013-12-10T20:43:40.459Z","1.0.1-pre":"2013-12-10T21:13:13.539Z"},"author":{"name":"jden"},"repository":{"type":"git","url":"git@github.com:jden/rope.git"},"homepage":"https://github.com/jden/rope","bugs":{"url":"https://github.com/jden/rope/issues"},"license":"MIT","readmeFilename":"README.md"}