                 'xyz'
             """
 
-        'has a complexity of three' : (complexity) ->
+        'has a complexity of three' : (source) ->
+            complexity = getComplexity(source)
             assert.equal(complexity, 3)
 
     'If If-Else Else statement' :
 
-        topic : getComplexity(
-            """
+        topic : """
             z = () ->
               if x
                 1


    'An empty function' :

        topic : getComplexity "x = () -> 1234"

        'has a complexity of one' : (complexity) ->
            assert.equal(complexity, 1)

    'If statement' :

        topic : getComplexity "x = () -> 2 if $ == true"

        'has a complexity of two' : (complexity) ->
            assert.equal(complexity, 2)

    'If Else statement' :

        topic : getComplexity 'y = -> if $ then 1 else 3'

        'has a complexity of two' : (complexity) ->
            assert.equal(complexity, 2)

    'If ElseIf statement' :

        topic : getComplexity """
            x = ->
              if 1233
                'abc'

                2
              else
                3
            """

        'has a complexity of three' : (source) ->
            complexity = getComplexity(source)
            assert.equal(complexity, 3)

    'Nested if statements' :

        topic : """
            z = () ->
              if abc?
                if other?
                  123
            """

        'has a complexity of three' : (source) ->
            complexity = getComplexity(source)
            assert.equal(complexity, 3)


    'A while loop' :

        topic : """
            x = () ->
              while 1
                'asdf'
            """

        'increments complexity' : (source) ->
            complexity = getComplexity(source)
            assert.equal(complexity, 2)

    'An until loop' :

        topic : "x = () -> log 'a' until $?"

        'increments complexity' : (source) ->
            complexity = getComplexity(source)
            assert.equal(complexity, 2)

}).export(module)
