       connection.status.should.equal 'open'
       connection.query().should.equal '5 little pigs'
 
-it 'should match to right lie if multiple per function', ->
-  liar = createLiar [{
-    function_name: 'add'
-    arguments: [2, 3]
-    returns:
-      value: 5
-  },{
-    function_name: 'add'
-    arguments: [5, 4]
-    returns:
-      value: 9
-  }]
-  liar.add(2,3).should.equal 5
-  liar.add(5,4).should.equal 9
+  it 'should match to right lie if multiple per function', ->
+    liar.expect [{
+      function_name: 'add'
+      arguments: [2, 3]
+      returns:
+        value: 5
+    },{
+      function_name: 'add'
+      arguments: [5, 4]
+      returns:
+        value: 9
+    }]
+    liar.add(2,3).should.equal 5
+    liar.add(5,4).should.equal 9
 
 
+  describe 'Syntax checking', ->
 
+    it 'should validate that return has a value property', ->
+      (->
+        liar.expect
+          function_name: 'something'
+          returns:
+            values: 'somevalue' # <- spelled wrong, an "s" at the end!
 
-describe 'Syntax checking', ->
+        liar.something()
 
-  it 'should validate that return has a value property', ->
-    (->
-      liar = createLiar [
-        function_name: 'something'
-        returns:
-          values: 'somevalue' # <- spelled wrong, an "s" at the end!
-      ]
-      liar.something()
+      ).should.throw 'returns object must have property "value" or "on_value"'
 
-    ).should.throw 'returns object must have property "value" or "on_value"'
+    it 'should validate function_name of root', ->
+      (->
+        liar.expect
+          function: 'do_stuff' # forgot _name
+      ).should.throw 'expectation must have property "function_name"'
 
-  it 'should validate function_name of root', ->
-    (->
-      liar = createLiar [
-        function: 'do_stuff' # forgot _name
-      ]
-    ).should.throw 'expectation must have property "function_name"'
+    it 'should validate that arguments is an array (root)', ->
+      (->
+        liar.expect
+          function_name: 'woop'
+          arguments: 'hats' # forgot the array brackets
+        liar.woop()
+      ).should.throw 'arguments must be of type Array.'
 
-  it 'should validate that arguments is an array (root)', ->
-    (->
-      liar = createLiar [
-        function_name: 'woop'
-        arguments: 'hats' # forgot the array brackets
-      ]
-      liar.woop()
-    ).should.throw 'arguments must be of type Array.'
-
-  it 'should validate that function is string', ->
-    (->
-      myFunc = -> # just declare a random function
-      liar = createLiar [
-        function_name: myFunc
-        returns: 9
-      ]
-    ).should.throw 'function_name must be a string.'
+    it 'should validate that function is string', ->
+      (->
+        myFunc = -> # just declare a random function
+        liar.expect
+          function_name: myFunc
+          returns: 9
+      ).should.throw 'function_name must be a string.'

expect      = chai.expect

lies        = require '../src/beautiful-lies'
createLiar = lies.createLiar

describe 'createLiar', ->

  it 'Should simulate a function call', ->

    liar = createLiar [
      function_name: 'someFunction'
      returns:
        value:
          someProperty: 5
    ]

    liar.someFunction().should.deep.equal
      someProperty: 5

  describe 'When returns.self is true', ->
    liar = null
    beforeEach ->
      liar = createLiar
        function_name: 'superFunction'
        returns:
          self: true

      liar.superFunction().should.equal liar

  describe 'When returns.self is false', ->
    beforeEach ->
      liar.expect
        function_name: 'superFunction'
        returns:
          self: false
