Skip to content

Commit

Permalink
chore: remove unused/unneeded dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaultcha committed May 6, 2015
1 parent 6728175 commit 38bee5a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TESTING_CONF = kong_TEST.yml
DEVELOPMENT_CONF = kong_DEVELOPMENT.yml
DEV_ROCKS=busted luacov luacov-coveralls luacheck
DEV_ROCKS=busted luacov luacov-coveralls luacheck inspect lua-llthreads2

.PHONY: install dev clean run seed drop lint test coverage test-all

Expand Down
3 changes: 0 additions & 3 deletions kong-0.2.1-1.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,13 @@ dependencies = {
"yaml ~> 1.1.1-1",
"luasec ~> 0.5-2",
"lapis ~> 1.1.0-1",
"inspect ~> 3.0-1",
"stringy ~> 0.4-1",
"multipart ~> 0.1-2",
"cassandra ~> 0.5-7",
"lua-path ~> 0.2.3-1",
"lua-cjson ~> 2.1.0-1",
"luasocket ~> 2.0.2-5",
"ansicolors ~> 1.0.2-3",
"lrexlib-pcre ~> 2.7.2-1",
"lua-llthreads2 ~> 0.1.3-1",
"multipart ~> 0.1-2"
}
build = {
Expand Down
5 changes: 3 additions & 2 deletions kong/tools/faker.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
local Object = require "classic"
local inspect = require "inspect"
local utils = require "kong.tools.utils"

math.randomseed(os.time())
Expand Down Expand Up @@ -194,7 +193,9 @@ function Faker:insert_from_table(entities_to_insert, pick_relations)
local dao_type = type=="plugin_configuration" and "plugins_configurations" or type.."s"
local res, err = self.dao_factory[dao_type]:insert(entity)
if err then
error("Faker failed to insert "..type.." entity: "..inspect(entity).."\n"..err)
local printable_mt = require "kong.tools.printable"
setmetatable(entity, printable_mt)
error("Faker failed to insert "..type.." entity: "..entity.."\n"..err)
end

-- For other hard-coded entities relashionships
Expand Down
5 changes: 3 additions & 2 deletions spec/unit/faker_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,15 @@ describe("Faker #tools", function()
end)

it("should throw a descriptive error if cannot insert an entity", function()
local inspect = require "inspect"
local printable_mt = require "kong.tools.printable"
local entity_to_str = setmetatable(Faker.FIXTURES.api[1], printable_mt)

factory_mock.apis.insert = function(self, t)
return nil, DaoError("cannot insert api error test", "schema")
end
assert.has_error(function()
faker:seed()
end, "Faker failed to insert api entity: "..inspect(Faker.FIXTURES.api[1]).."\ncannot insert api error test")
end, "Faker failed to insert api entity: "..entity_to_str.."\ncannot insert api error test")
end)

end)
Expand Down

0 comments on commit 38bee5a

Please sign in to comment.