Skip to content

Commit

Permalink
Merge pull request #793 from 3scale/trailing-whitespace
Browse files Browse the repository at this point in the history
[luacheck] strip trailing whitespace
  • Loading branch information
mikz authored Jun 27, 2018
2 parents b546f7d + 8afa7b6 commit 068cb2f
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion gateway/src/apicast/policy/rate_limit/redis_shdict.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ function _M:flush_all()
redis:flushdb()
end

return _M
return _M
16 changes: 8 additions & 8 deletions spec/configuration_loader/remote_v2_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('Configuration Remote Loader V2', function()
assert.equal(2, #services)
assert.same({ { service = { id = 11 } }, { service = { id = 42 } } }, services)
end)

it('returns list of services when APICAST_SERVICES is set', function()
env.set('APICAST_SERVICES', '11,42')

Expand All @@ -87,7 +87,7 @@ describe('Configuration Remote Loader V2', function()
assert.equal(1, #services)
assert.same({ { service = { id = 1 } } }, services)
end)

it('ignores APICAST_SERVICES when empty', function()
env.set('APICAST_SERVICES', '')

Expand All @@ -100,24 +100,24 @@ describe('Configuration Remote Loader V2', function()
assert.equal(1, #services)
assert.same({ { service = { id = 1 } } }, services)
end)

it('ignores APICAST_SERVICES when empty and returns a list of services when APICAST_SERVICES_LIST is set', function()
env.set('APICAST_SERVICES', '')
env.set('APICAST_SERVICES_LIST', '11,42')

local services = loader:services()

assert.truthy(services)
assert.equal(2, #services)
assert.same({ { service = { id = 11 } }, { service = { id = 42 } } }, services)
end)

it('ignores APICAST_SERVICES_LIST when empty and returns a list of services when APICAST_SERVICES is set', function()
env.set('APICAST_SERVICES_LIST', '')
env.set('APICAST_SERVICES', '11,42')

local services = loader:services()

assert.truthy(services)
assert.equal(2, #services)
assert.same({ { service = { id = 11 } }, { service = { id = 42 } } }, services)
Expand Down
16 changes: 8 additions & 8 deletions spec/configuration_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ describe('Configuration object', function()

assert.same({ ['42'] = true, ['21'] = true }, services)
end)

it('reads from environment', function()
env.set('APICAST_SERVICES_LIST', '42,21')

Expand All @@ -144,30 +144,30 @@ describe('Configuration object', function()

assert.same({}, services)
end)

it('reads from environment', function()
env.set('APICAST_SERVICES_LIST', '')

local services = services_limit()

assert.same({}, services)
end)

it('reads from environment', function()
env.set('APICAST_SERVICES_LIST', '42,21')
env.set('APICAST_SERVICES', '')

local services = services_limit()

assert.same({ ['42'] = true, ['21'] = true }, services)
end)

it('reads from environment', function()
env.set('APICAST_SERVICES', '42,21')
env.set('APICAST_SERVICES_LIST', '')

local services = services_limit()

assert.same({ ['42'] = true, ['21'] = true }, services)
end)
end)
Expand Down
2 changes: 1 addition & 1 deletion spec/luassert_helper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ do -- adding assert.returns_error(error_text, ok, ret) : assert.returns_error('n
end

assert:register("assertion", "returns_error", returns_error, "assertion.error.positive", "assertion.error.negative")
end
end
2 changes: 1 addition & 1 deletion spec/policy/rate_limit/redis_shdict_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ describe('Redis Shared Dictionary', function()
assert.near(1, redis:ttl('somekey'), 0.1)
end)
end)
end)
end)
2 changes: 1 addition & 1 deletion spec/spec_helper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ end)

busted.subscribe({ 'file', 'end' }, function ()
collectgarbage()
end)
end)

0 comments on commit 068cb2f

Please sign in to comment.