Skip to content

Commit

Permalink
travis testing
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanrossUK committed May 30, 2017
1 parent 57d3ba7 commit a0cdb89
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 0 deletions.
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2015 stephenyeargin

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39 changes: 39 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "hubot-strava",
"description": "Get the latest activities from your Strava friends.",
"version": "0.0.1",
"author": "liquidstate",
"license": "MIT",
"keywords": [
"hubot",
"hubot-scripts",
"strava"
],
"repository": {
"type": "git",
"url": "[email protected]:liquidstate/hubot-strava.git"
},
"bugs": {
"url": "https://github.com/liquidstate/hubot-strava/issues"
},
"dependencies": {
},
"devDependencies": {
"chai": "^3.5.0",
"coffee-script": "1.12.5",
"grunt": "^1.0.1",
"grunt-cli": "^1.2.0",
"grunt-contrib-watch": "~1.0.0",
"grunt-mocha-test": "~0.13.2",
"grunt-release": "~0.14.0",
"hubot": "2.x",
"matchdep": "~1.0.1",
"mocha": "^3.3.0",
"sinon": "^2.2.0",
"sinon-chai": "^2.10.0"
},
"main": "index.coffee",
"scripts": {
"test": "grunt test"
}
}
18 changes: 18 additions & 0 deletions script/bootstrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# Make sure everything is development forever
export NODE_ENV=development

# Load environment specific environment variables
if [ -f .env ]; then
source .env
fi

if [ -f .env.${NODE_ENV} ]; then
source .env.${NODE_ENV}
fi

npm install

# Make sure coffee and mocha are on the path
export PATH="node_modules/.bin:$PATH"
6 changes: 6 additions & 0 deletions script/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# bootstrap environment
source script/bootstrap

mocha --compilers coffee:coffee-script
22 changes: 22 additions & 0 deletions test/hubot-strave_test.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
chai = require 'chai'
sinon = require 'sinon'
chai.use require 'sinon-chai'

expect = chai.expect

describe 'hubot-strava', ->
beforeEach ->
@robot =
respond: sinon.spy()
hear: sinon.spy()

require('../src/hubot-strava')(@robot)

it 'registers a respond listener for Strava', ->
expect(@robot.respond).to.have.been.calledWith(/strava$/i)

it 'registers a respond listener for Strava friend listing', ->
expect(@robot.respond).to.have.been.calledWith(/strava friends$/i)

it 'registers a respond listener for Strava user search', ->
expect(@robot.respond).to.have.been.calledWith(/strava user (.+)$/i)

0 comments on commit a0cdb89

Please sign in to comment.