{"_id":"testosterone","_rev":"40-7925aaed1d80d28d4a98463dda823c12","name":"testosterone","description":"Virile testing for http servers or any nodejs application","dist-tags":{"latest":"1.3.1"},"versions":{"0.0.1":{"name":"testosterone","description":"Synchronous testing for virile http servers","version":"0.0.1","repository":"git://github.com/masylum/testosterone.git","author":{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"},"directories":{"lib":"lib"},"engines":{"node":"*"},"_id":"testosterone@0.0.1","_engineSupported":true,"_npmVersion":"0.2.13-2","_nodeVersion":"v0.2.3","dist":{"shasum":"45167e85606a78bb07bca4c0f937029f05390f68","tarball":"https://registry.npmjs.org/testosterone/-/testosterone-0.0.1.tgz","integrity":"sha512-fwDE4K3X8Ff0ICXZzDf5SaxMB4vzVOZeT8dpDcHZUKKTblZAnNUfyQWb2eoOmgqwZrUOC/x9t2X5XE7C1Tt0/Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH0qtWseK3pennrDwLluRFk0Src9aTq3vCbF665slOBVAiBhmrTFvXOtLrCwnhqy2uTGl72HhhopwYHazku2JJLblA=="}]}},"0.0.2":{"name":"testosterone","description":"Synchronous testing for virile http servers","version":"0.0.2","repository":"git://github.com/masylum/testosterone.git","author":{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"},"directories":{"lib":"lib"},"main":"index","engines":{"node":"*"},"_id":"testosterone@0.0.2","_engineSupported":true,"_npmVersion":"0.2.13-2","_nodeVersion":"v0.2.3","dist":{"shasum":"c1f8fc0a3d1f4cb0ce406422610724db6352258f","tarball":"https://registry.npmjs.org/testosterone/-/testosterone-0.0.2.tgz","integrity":"sha512-1DDj7XWJqsK/x6669ymgw+GTHXmREn3boLDOuJ0/op48weejPTp8aQlAt6mDvnuLBLWkTinrWTwbsmwXC5oORw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrnxsDu+VVXEQsskg9TK/dnqddaTRh6BvKxvt8qXYwdAIgO/2aTVa+27kq/8p/nfGv2Ydb101lyJb+RZWIIrfXhI0="}]}},"0.0.3":{"name":"testosterone","description":"Synchronous testing for virile http servers","version":"0.0.3","repository":"git://github.com/masylum/testosterone.git","author":{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"},"directories":{"lib":"lib"},"main":"index","engines":{"node":"*"},"_id":"testosterone@0.0.3","_engineSupported":true,"_npmVersion":"0.2.13-2","_nodeVersion":"v0.2.3","dist":{"shasum":"8a19be9f0237f122b17dbc090e2a2c265de298a8","tarball":"https://registry.npmjs.org/testosterone/-/testosterone-0.0.3.tgz","integrity":"sha512-TioKp7XilgYzCPSDxNKL/nK0BFl3o+oLNj7PQkmO3FNysKICSYjl3I0h/T3N4BvPCwyzTEzv4cHVU78Wqs31oQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVwHFFd0rUezogQLMOa+QUq1P9H2va5vcuTe9IO4F4LAIgOUrcuhuKMLW0rDVkNb4XXxmeSNq5mVIIOiRQ/Efcil8="}]}},"0.0.4":{"name":"testosterone","description":"Synchronous testing for virile http servers","version":"0.0.4","repository":"git://github.com/masylum/testosterone.git","author":{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"},"directories":{"lib":"lib"},"main":"index","engines":{"node":"*"},"_id":"testosterone@0.0.4","_engineSupported":true,"_npmVersion":"0.2.13-2","_nodeVersion":"v0.2.3","dist":{"shasum":"f6d4bb340c1adfee7b938f068ab22561aec50c29","tarball":"https://registry.npmjs.org/testosterone/-/testosterone-0.0.4.tgz","integrity":"sha512-f9+W8kjHyTyMRQBIiQ5+njxKNqkD2yLq5E7IG6w0jKBI4PeP9sATNXUGFoftadHmO6PCIzVOq5kb/ZJ5sPHaag==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAQMj+ASf36okOt/UDG+oe6mpUsM7lQRsr9IcO9dQ276AiAEDNGtJxzTKIXngDL/t8awzaM3ebmz/gGRCVIabvf9eA=="}]}},"0.0.5":{"name":"testosterone","description":"Synchronous testing for virile http servers","version":"0.0.5","repository":"git://github.com/masylum/testosterone.git","author":{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"},"directories":{"lib":"lib"},"main":"index","engines":{"node":"*"},"_id":"testosterone@0.0.5","_engineSupported":true,"_npmVersion":"0.2.13-2","_nodeVersion":"v0.2.3","dist":{"shasum":"761db0d1b02aa498a9100dacf353cc3257850345","tarball":"https://registry.npmjs.org/testosterone/-/testosterone-0.0.5.tgz","integrity":"sha512-I39N7F5gfswJesT8LtjGg93tCyio+kTnxa+9SLWb36XSyGt9wVYpHRIrX588bC4PAwVAhH7ZGqxtiam4Pdn9Og==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCxFCO5wEM7Uf1F1DrdOw/ZcKH38Kskpygye+3h7+n+8AIgai6+lJCJYuaTswcOxL9lEk/oT1GG94279ASUV+xtMSc="}]}},"0.0.6":{"name":"testosterone","description":"Synchronous testing for virile http servers","version":"0.0.6","repository":"git://github.com/masylum/testosterone.git","author":{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"},"directories":{"lib":"lib"},"main":"index","engines":{"node":"*"},"_id":"testosterone@0.0.6","_engineSupported":true,"_npmVersion":"0.2.13-2","_nodeVersion":"v0.2.3","dist":{"shasum":"7ee34a8f0cd41979ac48c827df33c0809ec5ed78","tarball":"https://registry.npmjs.org/testosterone/-/testosterone-0.0.6.tgz","integrity":"sha512-rB89iq8Dyi1Ai2MC1cFjSuDN9TbMB44THeYh1VfK+vJ4TyPQGHy5eSD3eiy1CfhQyVNXMI49NY9MfEUKNuk7+Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDTU5XQ+YG5yEE2/i/EBXDaMtfXP+KSzz5EowXADAFJ2AiAjiHmEWV+WUdMInwRfpST3HI8fHcDNpbgIrx23sol2tA=="}]}},"0.0.7":{"name":"testosterone","description":"Synchronous testing for virile http servers","version":"0.0.7","repository":"git://github.com/masylum/testosterone.git","author":{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"},"directories":{"lib":"lib"},"main":"index","engines":{"node":"*"},"_id":"testosterone@0.0.7","_engineSupported":true,"_npmVersion":"0.2.13-2","_nodeVersion":"v0.2.3","dist":{"shasum":"f700d1383509a4d1a1840ca58e73511ce1f38ab1","tarball":"https://registry.npmjs.org/testosterone/-/testosterone-0.0.7.tgz","integrity":"sha512-AW3NoGQ6MNHLallZhiID+oKz2F0nalRDbmZCkT5CdS3OGjImb9wjh3ZCZdoEzdOrPoxiB2SkKZObMrXIK2mABw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4YqcUQ+l/DhEvL3YZEXasP7M6CWibdePtFQlPiPv/ZwIgfb4bchgsin+QBikDHmQYm/wYb+U12GAkTaOH1G569CM="}]}},"1.0.0":{"name":"testosterone","description":"Virile testing for http servers or any nodejs application","version":"1.0.0","repository":"git://github.com/masylum/testosterone.git","author":{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"},"directories":{"lib":"lib"},"dependencies":{"funk":">=1.0.1","colors":">=0.3.0"},"main":"index","engines":{"node":"*"},"_id":"testosterone@1.0.0","_engineSupported":true,"_npmVersion":"0.2.14-3","_nodeVersion":"v0.2.6","modules":{"b/testosterone.js":"lib/testosterone.js"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"1debe56c8fd674e19cf15f4693b7c37761693789","tarball":"https://registry.npmjs.org/testosterone/-/testosterone-1.0.0.tgz","integrity":"sha512-N2smw13x8wiyLjFQ9Fft87wjqOl7lUdEUbTyQxEJxlNaIvqsKzKKgPHHTkGJGrkP/ZPAadr1vxSUdCapgjNjDw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB327EyIaOZ+8kPUTbdMRAhLCoLtkNOcK08Tg/7MpsByAiBQbhXCno4UVoPaOtKeXE38YAATN99Gf6TZmHNQSmgLug=="}]}},"1.1.0":{"name":"testosterone","description":"Virile testing for http servers or any nodejs application","version":"1.1.0","repository":"git://github.com/masylum/testosterone.git","author":{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"},"directories":{"lib":"lib"},"dependencies":{"funk":">=1.0.1","colors":">=0.3.0"},"main":"index","engines":{"node":"*"},"_id":"testosterone@1.1.0","_engineSupported":true,"_npmVersion":"0.2.19","_nodeVersion":"v0.4.2","files":[""],"_defaultsLoaded":true,"dist":{"shasum":"01570ccbe68f815a8c0dcd4a70301d0719bd69f4","tarball":"https://registry.npmjs.org/testosterone/-/testosterone-1.1.0.tgz","integrity":"sha512-VNrJfPtXYJbjVGz9zNMzQgTZodoQGC4pXMLVjxxtMCbFavCzxVQZfZduty3X2wOxQXFMbP/j2RAi6I922kS/Rg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEdc3/DRTyVKBzAlOKeM6nTDqH41Z95S6rkUm4UNWwBQIgfDqX72yQOiI15Ub/aw2A2l49Zjib50lQkOZfU9YiT1Q="}]}},"1.2.0":{"name":"testosterone","description":"Virile testing for http servers or any nodejs application","version":"1.2.0","repository":{"type":"git","url":"git://github.com/masylum/testosterone.git"},"author":{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"},"directories":{"lib":"lib"},"dependencies":{"colors":">=0.3.0"},"main":"index","engines":{"node":"*"},"devDependencies":{},"_id":"testosterone@1.2.0","_engineSupported":true,"_npmVersion":"1.0.1rc9","_nodeVersion":"v0.4.2","_defaultsLoaded":true,"dist":{"shasum":"068352996c8c37e5fa7a0941ae9d2d814fc9e6d1","tarball":"https://registry.npmjs.org/testosterone/-/testosterone-1.2.0.tgz","integrity":"sha512-NPLAq5181mncLP/fZY1/7pHIx/3x2ab90BqGNkelBsv7nhSTQI13Uywyau4PXYhTFPSu5NzZ4diAxOOrDrou3Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCox7spiDjC38HhVMIli1NTDxI0NlYU+CG4jMhWfrHtnwIhAIgFyZ1P9jvTl6PpqHdd/URUjJTeuKidb+aB4QTNoDGf"}]}},"1.3.0":{"name":"testosterone","description":"Virile testing for http servers or any nodejs application","version":"1.3.0","repository":{"type":"git","url":"git://github.com/masylum/testosterone.git"},"author":{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"},"directories":{"lib":"lib"},"dependencies":{"colors":">=0.3.0","underscore":"1.1.7"},"devDependencies":{"express":"2.4.3","gently":"0.9.1"},"main":"index","engines":{"node":"*"},"_npmJsonOpts":{"file":"/Users/masylum/.npm/testosterone/1.3.0/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"testosterone@1.3.0","_engineSupported":true,"_npmVersion":"1.0.13","_nodeVersion":"v0.4.9-pre","_defaultsLoaded":true,"dist":{"shasum":"e05719b4d00ca8d3b196d1dd1c80b09df01e48ea","tarball":"https://registry.npmjs.org/testosterone/-/testosterone-1.3.0.tgz","integrity":"sha512-B30qnrvQ2mN3ltuyIhg1PyM3iL0DQUzbvQzoUe0LMdi3JJ5znfjTO9KSO2EXp0OfsfL51ZPN0129QnxzmmniYQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhXtUMW7xxTsbxX4b411ixo/zyXh/yTz7P3CjduQgygwIgHnJJKpfhTvl/GWBmqa/JDiYKVfEVBfXAs5JubdkQLp0="}]},"scripts":{}},"1.3.1":{"name":"testosterone","description":"Virile testing for http servers or any nodejs application","version":"1.3.1","repository":{"type":"git","url":"git://github.com/masylum/testosterone.git"},"author":{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"},"directories":{"lib":"lib"},"dependencies":{"colors":">=0.3.0","underscore":"1.1.7"},"devDependencies":{"express":"2.5.6","gently":"0.9.1"},"main":"index","engines":{"node":"*"},"_npmUser":{"name":"masylum","email":"masylum@gmail.com"},"_id":"testosterone@1.3.1","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-2","_nodeVersion":"v0.6.5","_defaultsLoaded":true,"dist":{"shasum":"769c324e2232a487c90ba4063636bbcfe2b2f87e","tarball":"https://registry.npmjs.org/testosterone/-/testosterone-1.3.1.tgz","integrity":"sha512-66g/BUQROyD5T2Bmypc7gKpfFr+QlU1M+nCD0SqofwhZWYlcBdx4pCmvXTSbuENx9Yd1gqPb0N9fwF6PKpzA3w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEgS1jzygNYE/WC49prmox722cY0WODi3MQHBfmqGqhbAiEAli+lsyzfHpUhmmVr/Ol/rEN/tyWyQA7rfR6wNsQZZlA="}]},"maintainers":[{"name":"masylum","email":"masylum@gmail.com"}]}},"maintainers":[{"name":"masylum","email":"masylum@gmail.com"}],"time":{"modified":"2022-06-27T05:34:24.273Z","created":"2010-12-28T23:02:38.234Z","0.0.1":"2010-12-28T23:02:38.760Z","0.0.2":"2010-12-28T23:08:54.488Z","0.0.3":"2010-12-28T23:12:20.012Z","0.0.4":"2010-12-29T21:24:06.027Z","0.0.5":"2010-12-29T22:02:14.094Z","0.0.6":"2011-01-01T23:36:59.219Z","0.0.7":"2011-01-02T16:06:21.308Z","1.0.0":"2011-01-30T23:31:27.952Z","1.1.0":"2011-03-19T17:27:07.256Z","1.2.0":"2011-04-22T17:31:07.095Z","1.3.0":"2011-07-21T13:53:06.868Z","1.3.1":"2012-01-29T13:43:09.416Z"},"author":{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"},"repository":{"type":"git","url":"git://github.com/masylum/testosterone.git"},"readme":"# ✿ Testosterone\n\nVirile testing for http servers or any nodejs application.\n\n## Installation\n\n`npm install testosterone`\n\n## WhateverDrivenDevelopment\n\nTestosterone allows you to follow BDD or TDD on any of your projects using\nthe same testing library.\n\n<img src = \"https://github.com/masylum/testosterone/raw/master/testosterone.png\" border = \"0\" />\n\n## Options\n\n  * `host`: Host to do the http calls. *localhost*\n  * `port`: Port to do the http calls. *80*\n  * `output`: Configure the amount of verbosity you want for your tests\n    * `specs`: Print the specs *true*\n    * `ticks`: Print the ✓ and ✗ ticks *true*\n    * `summary`: Prints the summary *true*\n    * `title`: Prints the title *true*\n  * `title`: Test title, it will be printed out. *Testosterone*\n  * `sync`: If set to `true`, you don't need to call `done` to specify when your tests are done. *false*\n\n## API\n\n_testosterone_ API is simple and flexible.\n\n- `get|post|head|put|delete...(url, req, response, cb)`: Does a http call with the given request. If a response is given, testosterone will assert that the real response matches.\n- `add(spec, function(done))`: Adds a test. The test is considered executed when `done` function is called.\n- `before(function)`: Runs before each test.\n- `after(function)`: Runs after each test.\n- `run([cb])`: Runs the tests in serial. `cb` will be called once all the tests are executed.\n- `assert`: You **must** use this assert object instead of the native one.\n\nAll the functions are chainable.\n\n## Show me the code\n\nYou have more examples on the `test` folder:\n\n### HTTP testing example:\n\n``` javascript\nvar testosterone = require('testosterone')({port: 3000})\n  , assert = testosterone.assert;\n\ntestosterone\n  .get('/', function (res) {\n    assert.equal(res.statusCode, 200)\n  })\n\n  .get('/hi', function (res) {\n    assert.equal(res.statusCode, 500);\n    assert.equal(res.body, 'use post instead');\n  })\n\n  .post('/hi', {data: {message: 'hola'}}, {\n    status: 200\n  , body: 'hola'\n  });\n\n// Output\n\n$ node test.js\n\n✿ Testosterone : ✓ ✓ ✓ ✓ ✓\n» 3 responses, 5 asserts\n```\n\n### Asynchronous example:\n\n``` javascript\nvar testosterone = require('testosterone')({post: 3000, title: 'Testing async'})\n  , assert = testosterone.assert;\n\ntestosterone\n\n  .before(function () {\n    console.log('test about to run!');\n  })\n\n  // using done to tell testosterone when the test is done\n  .add('First test', function (done) {\n    setTimeout(function () {\n      assert.ok(true);\n      done();\n    }, 999);\n  })\n\n  // same but currying\n  .add('Second test', function (spec) {\n    assert.ok(true);\n\n    setTimeout(done(function () {\n      assert.ok(true);\n    }), 10);\n  })\n\n  .run(function () {\n    require('sys').print('All tests passed!');\n  });\n\n// Output\n\n$ node test.js\n\n✿ Testing async :\n\nFirst test => ✓\nSecond test => ✓ ✓\n\n» 0 responses, 3 asserts\n```\n\n### Example with [gently](https://github.com/felixge/node-gently.git) stubbing and `sync: true`:\n\n``` javascript\nvar testosterone = require('testosterone')({post: 3000, title: 'Testing with stubs', sync: true})\n  , gently = new (require('gently'))\n  , fs = require('fs')\n  , assert = testosterone.assert;\n\ntestosterone\n  .add('GIVEN foo.txt \\nWHEN its empty \\nTHEN it return null', function (spec) {\n    gently.expect(fs, 'readFile', function (path, encoding, cb) {\n      assert.equal(path, 'foo.txt');\n      cb(null, null);\n    });\n\n    fs.readFile('foo.txt', 'utf-8', function (er, data) {\n      assert.equal(er, null);\n      assert.equal(data, null);\n    });\n  })\n\n  .add('GIVEN foo.txt \\nWHEN it have content \\nTHEN it return that content', function (spec) {\n    gently.expect(fs, 'readFile', function (path, encoding, cb) {\n      assert.equal(path, 'foo.txt');\n      cb(null, 'foo');\n    });\n\n    fs.readFile('foo.txt', 'utf-8', function (er, data) {\n      assert.equal(er, null);\n      assert.equal(data, 'foo');\n    });\n  })\n\n  .run(function () {\n    require('sys').print('done!');\n  });\n\n// Output\n\n$ node test.js\n\n✿ Testing with stubs :\n\nGIVEN foo.txt\nWHEN its empty\nTHEN it return null => ✓ ✓ ✓\n\nGIVEN foo.txt\nWHEN it have content\nTHEN it return that content => ✓ ✓ ✓\n\n» 6 asserts\n```\n\n## Test\n\nIn order to run the tests type:\n\n``` bash\nnpm install\nmake test_app\nmake\n```\n\n## Credits\n\nThe *_call* function of this library is a shameless copy from [expresso](https://github.com/visionmedia/expresso) response assert done by TJ Holowaychuk ([visionmedia](http://github.com/visionmedia))\n","readmeFilename":""}