Skip to content

Commit

Permalink
Updated for easier testing and new lusty
Browse files Browse the repository at this point in the history
  • Loading branch information
DorianGray committed Nov 20, 2014
1 parent 22bb460 commit 06a5bbd
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
14 changes: 7 additions & 7 deletions lusty-nginx-0.4-0.rockspec → lusty-nginx-0.5-0.rockspec
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package = "lusty-nginx"
version = "0.4-0"
version = "0.5-0"
source = {
url = "https://github.com/Olivine-Labs/lusty-nginx/archive/v0.4.tar.gz",
dir = "lusty-nginx-0.4"
url = "https://github.com/Olivine-Labs/lusty-nginx/archive/v0.5.tar.gz",
dir = "lusty-nginx-0.5"
}
description = {
summary = "Nginx plugin for lusty.",
Expand All @@ -18,9 +18,9 @@ dependencies = {
build = {
type = "builtin",
modules = {
["lusty-nginx.init"] = "src/init.lua",
["lusty-nginx.request"] = "src/request.lua",
["lusty-nginx.response"] = "src/response.lua",
["lusty-nginx.log"] = "src/log.lua"
["lusty-nginx.init"] = "lusty-nginx/init.lua",
["lusty-nginx.request"] = "lusty-nginx/request.lua",
["lusty-nginx.response"] = "lusty-nginx/response.lua",
["lusty-nginx.log"] = "lusty-nginx/log.lua"
}
}
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/request.lua → lusty-nginx/request.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ return {
end,

uri = function(request)
return request.url or ngx.var.uri
return request.url or ngx and ngx.var.uri or ''
end,

host = function(request)
Expand Down
File renamed without changes.
5 changes: 2 additions & 3 deletions spec/interface_spec.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package.path = './spec/?.lua;../src/?.lua;'..package.path
ngx = {
var = {
uri = ""
Expand All @@ -8,12 +7,12 @@ describe("log interface", function()
local lusty = require 'lusty'()

it("has a request function", function()
local server = require 'init'(lusty)
local server = require 'lusty-nginx'(lusty)
assert.are.equal(type(server.request), "function")
end)

it("doesn't break when I try to run that function without nginx", function()
local server = require 'init'(lusty)
local server = require 'lusty-nginx'(lusty)
assert.has_no.errors(function() server.request() end)
end)

Expand Down

0 comments on commit 06a5bbd

Please sign in to comment.