Skip to content
Browse files

integration tests for utilities helper class.

  • Loading branch information...
1 parent 44c4edb commit 53a99f374e0a05b6fa760a40d3a8ad2b44a676d1 @thehunmonkgroup committed Sep 11, 2011
Showing with 34 additions and 3 deletions.
  1. +34 −3 luchia/tests/integration/utilities.lua
View
37 luchia/tests/integration/utilities.lua
@@ -1,8 +1,39 @@
-local common = require "luchia.tests.common"
-local server = require "luchia.utilities"
+local utilities = require "luchia.utilities"
local tests = {}
+local util
-return tests
+function tests.setup()
+ util = utilities:new()
+ assert_table(util, "Unable to create utilities server")
+end
+
+function tests.teardown()
+ util = nil
+end
+
+function tests.test_version()
+ local server = require "luchia.core.server"
+ local srv = server:new()
+ local info = srv:request()
+ local version = util:version()
+ assert_equal(info.version, version, "Unable to get matching version information")
+end
+
+function tests.test_config()
+ local config = util:config()
+ assert_table(config.httpd)
+end
+function tests.test_stats()
+ local stats = util:stats()
+ assert_table(stats.couchdb)
+end
+
+function tests.test_active_tasks()
+ local active_tasks = util:active_tasks()
+ assert_table(active_tasks)
+end
+
+return tests

0 comments on commit 53a99f3

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