Skip to content
This repository has been archived by the owner on Sep 29, 2021. It is now read-only.

Commit

Permalink
first test for adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
jonfreedman committed Jul 19, 2016
1 parent 8edf8b2 commit e0e6404
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions test/adapter-test.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# Copyright 2016 The Symphony Software Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

assert = require('chai').assert
SymphonyAdapter = require '../src/adapter'

describe 'Adapter test suite', () ->
constructorProps = ['HUBOT_SYMPHONY_HOST', 'HUBOT_SYMPHONY_PUBLIC_KEY', 'HUBOT_SYMPHONY_PRIVATE_KEY', 'HUBOT_SYMPHONY_PASSPHRASE']

for constructorProp in constructorProps
it "should throw on construction if #{constructorProp} missing", () ->
process.env[propToSet] = 'foo' for propToSet in constructorProps.filter (p) -> p isnt constructorProp
assert.throws(SymphonyAdapter.use, new RegExp("#{constructorProp} undefined"))
2 changes: 1 addition & 1 deletion test/symphony-test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ describe 'REST API test suite', () ->

describe 'Object model test suite', () ->
for text in ['<messageML>Hello World</messageML>', 'Hello World']
it 'parse a V2Message containing ' + text, () ->
it "parse a V2Message containing '#{text}'", () ->
msg = {
id: 'foobar'
v2messageType: 'V2Message'
Expand Down

0 comments on commit e0e6404

Please sign in to comment.