 path   = require 'path'
 nock   = require 'nock'
 sinon  = require 'sinon'
+moment = require 'moment'
 expect = require('chai').use(require('sinon-chai')).expect
 
 room = null

        it 'returns name of who is on call', ->
          expect(hubotResponse())
          .to.eql 'Tim Wright is on call until Saturday 20:28 (utc).'

  # ------------------------------------------------------------------------------------------------
  describe '".pd next oncall"', ->


  # ------------------------------------------------------------------------------------------------
  describe '".pd oncall"', ->
    context 'when something goes wrong,', ->
      beforeEach ->
        room.robot.brain.data.pagerv2 = { users: { } }
        nock('https://api.pagerduty.com')
        .get('/oncalls?time_zone=UTC&schedule_ids%5B%5D=42&earliest=true')
        .reply 503, { error: { code: 503, message: "it's all broken!" } }
      afterEach ->
        room.robot.brain.data.pagerv2 = { }
        nock.cleanAll()

      say 'pd oncall', ->
        it 'returns name of who is on call', ->
          expect(hubotResponse())
          .to.eql "503 it's all broken!"

    context 'when everything goes right,', ->
      beforeEach ->
        room.robot.brain.data.pagerv2 = { users: { } }
