Skip to content

Commit

Permalink
chore(tests) move constant tests in static_specs
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaultcha committed Aug 25, 2015
1 parent c9e11ba commit 6f95846
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
9 changes: 0 additions & 9 deletions spec/unit/constants_spec.lua

This file was deleted.

6 changes: 4 additions & 2 deletions spec/unit/statics_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ local IO = require "kong.tools.io"
local fs = require "luarocks.fs"

describe("Static files", function()

describe("Constants", function()

it("version set in constants should match the one in the rockspec", function()
local rockspec_path
for _, filename in ipairs(fs.list_dir(".")) do
Expand All @@ -30,6 +28,10 @@ describe("Static files", function()
assert.are.same(constants.VERSION, dash and extracted_version:sub(1, dash - 1) or extracted_version)
end)

it("accessing non-existing error code should throw an error", function()
assert.has_no_error(function() local _ = constants.DATABASE_ERROR_TYPES.DATABASE end)
assert.has_error(function() local _ = constants.DATABASE_ERROR_TYPES.ThIs_TyPe_DoEs_NoT_ExIsT end)
end)
end)

describe("Configuration", function()
Expand Down

0 comments on commit 6f95846

Please sign in to comment.