Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[tests] stylize

  • Loading branch information...
commit e53e619b902a568afedf8f6cb7f3d346f8980a3d 1 parent b60b927
Edward Hotchkiss authored March 23, 2012

Showing 1 changed file with 39 additions and 34 deletions. Show diff stats Hide diff stats

  1. 73  test/index.test.js
73  test/index.test.js
... ...
@@ -1,83 +1,88 @@
1 1
 
2  
-var vows = require("vows");
3  
-var util = require("util");
4  
-var assert = require("assert");
5  
-var should = require("should");
  2
+/**
  3
+ * requure
  4
+ */
6 5
 
7  
-var klout = require("../lib/klout");
  6
+var vows = require('vows')
  7
+  , util = require('util')
  8
+  , assert = require('assert')
  9
+  , should = require('should')
  10
+  , klout = require('../lib/klout');
8 11
 
9  
-klout.configure("MY_API_KEY", "json", "1");
  12
+var API_KEY = process.env.KLOUT_API_KEY || '';
10 13
 
11  
-vows.describe("general module tests").addBatch({
12  
-  "when requiring klout":{
  14
+klout.configure(API_KEY, 'json', '1');
  15
+
  16
+vows.describe('general module tests').addBatch({
  17
+  'when requiring klout':{
13 18
     topic:function(){ 
14 19
       return klout;
15 20
     },
16  
-    "klout should be a function":function(topic){
17  
-      topic.should.be.a("function");
  21
+    'klout should be a function':function(topic){
  22
+      topic.should.be.a('function');
18 23
     }
19 24
   },
20 25
   // score methods
21  
-  "when requesting a single users klout":{
  26
+  'when requesting a single users klout':{
22 27
     topic:function(){
23  
-      klout.getKlout("kisshotch", this.callback);
  28
+      klout.getKlout('kisshotch', this.callback);
24 29
     },
25  
-    "we should be able to get a klout score, with no errors, and a user object with a length":function(error, users){
  30
+    'we should be able to get a klout score, with no errors, and a user object with a length':function(error, users){
26 31
       assert.equal(error, null);
27 32
       assert.notEqual(users.users.length, undefined);
28  
-      users.should.be.a("object");
  33
+      users.should.be.a('object');
29 34
     }
30 35
   },
31  
-  "when requesting multipel users klout scores":{
  36
+  'when requesting multipel users klout scores':{
32 37
     topic:function(){
33  
-      klout.getKlout("kisshotch,hankejh,craigablerino", this.callback);
  38
+      klout.getKlout('kisshotch,hankejh,craigablerino', this.callback);
34 39
     },
35  
-    "we should be able to get a set of klout scores, with no errors, users as an object and users should have a length":function(error, users){
  40
+    'we should be able to get a set of klout scores, with no errors, users as an object and users should have a length':function(error, users){
36 41
       assert.equal(error, null);
37 42
       assert.notEqual(users.users.length, undefined);
38  
-      users.should.be.a("object");
  43
+      users.should.be.a('object');
39 44
     }
40 45
   },
41 46
   // user methods
42  
-  "when requesting a users user object":{
  47
+  'when requesting a users user object':{
43 48
     topic:function(){
44  
-      klout.getShow("kisshotch", this.callback);
  49
+      klout.getShow('kisshotch', this.callback);
45 50
     },
46  
-    "we should be able to get a user object, with no errors, and a user object with a length":function(error, users){
  51
+    'we should be able to get a user object, with no errors, and a user object with a length':function(error, users){
47 52
       assert.equal(error, null);
48 53
       assert.notEqual(users.users.length, undefined);
49  
-      users.should.be.a("object");
  54
+      users.should.be.a('object');
50 55
     }
51 56
   },
52  
-  "when requesting a users topics":{
  57
+  'when requesting a users topics':{
53 58
     topic:function(){
54  
-      klout.getTopics("kisshotch", this.callback);
  59
+      klout.getTopics('kisshotch', this.callback);
55 60
     },
56  
-    "we should be able to get a user object, with no errors, and a user object with a length":function(error, users){
  61
+    'we should be able to get a user object, with no errors, and a user object with a length':function(error, users){
57 62
       assert.equal(error, null);
58 63
       assert.notEqual(users.users.length, undefined);
59  
-      users.should.be.a("object");
  64
+      users.should.be.a('object');
60 65
     }
61 66
   },
62 67
   // influence methods
63  
-  "when requesting a users object with who they're influenced by":{
  68
+  'when requesting a users object with who they\'re influenced by':{
64 69
     topic:function(){
65  
-      klout.getInfluencedBy("kisshotch", this.callback);
  70
+      klout.getInfluencedBy('kisshotch', this.callback);
66 71
     },
67  
-    "we should be able to get a user object, with no errors, and a user object with a length":function(error, users){
  72
+    'we should be able to get a user object, with no errors, and a user object with a length':function(error, users){
68 73
       assert.equal(error, null);
69 74
       assert.notEqual(users.users.length, undefined);
70  
-      users.should.be.a("object");
  75
+      users.should.be.a('object');
71 76
     }
72 77
   },
73  
-  "when requesting the users that influence users":{
  78
+  'when requesting the users that influence users':{
74 79
     topic:function(){
75  
-      klout.getInfluencerOf("kisshotch", this.callback);
  80
+      klout.getInfluencerOf('kisshotch', this.callback);
76 81
     },
77  
-    "we should be able to get a user object, with no errors, and a user object with a length":function(error, users){
  82
+    'we should be able to get a user object, with no errors, and a user object with a length':function(error, users){
78 83
       assert.equal(error, null);
79 84
       assert.notEqual(users.users.length, undefined);
80  
-      users.should.be.a("object");
  85
+      users.should.be.a('object');
81 86
     }
82 87
   },
83 88
 }).export(module);

0 notes on commit e53e619

Please sign in to comment.
Something went wrong with that request. Please try again.