         @unitResults = []
         @result = null
     define: (fun) ->
-        fun(@env)
-        @
+        fun(@_env)
+        @
+    getEnv: ->
+        r = $mate.testing.objectClone(@_env)
+        @getAncestors().forEach((ancestor) ->
+            Object.keys(ancestor._env).forEach((key) ->
+                if key not in Object.keys(r) then r[key] = ancestor._env[key]
+            )
+        )
+        r
     set: (fun) ->
         @_fun = fun
         @


class $mate.testing.Test
    constructor: (@description = "") ->
        @env = {}
        @_children = []
        @_fun = null
        @_interpretedFunction = null

                        @finish(type: false)
            , 0)
        @getChildren().forEach((m) =>
            m.run(false)
        )
        if showsMessage
