{"action":"opened","issue":{"url":"https://api.github.com/repos/leafo/lapis/issues/337","labels_url":"https://api.github.com/repos/leafo/lapis/issues/337/labels{/name}","comments_url":"https://api.github.com/repos/leafo/lapis/issues/337/comments","events_url":"https://api.github.com/repos/leafo/lapis/issues/337/events","html_url":"https://github.com/leafo/lapis/issues/337","id":107774182,"number":337,"title":"Testing modules that use OpenResty components","user":{"login":"erikcw","id":113129,"avatar_url":"https://avatars.githubusercontent.com/u/113129?v=3","gravatar_id":"","url":"https://api.github.com/users/erikcw","html_url":"https://github.com/erikcw","followers_url":"https://api.github.com/users/erikcw/followers","following_url":"https://api.github.com/users/erikcw/following{/other_user}","gists_url":"https://api.github.com/users/erikcw/gists{/gist_id}","starred_url":"https://api.github.com/users/erikcw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erikcw/subscriptions","organizations_url":"https://api.github.com/users/erikcw/orgs","repos_url":"https://api.github.com/users/erikcw/repos","events_url":"https://api.github.com/users/erikcw/events{/privacy}","received_events_url":"https://api.github.com/users/erikcw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-22T18:36:06Z","updated_at":"2015-09-22T18:36:06Z","closed_at":null,"body":"I haven't been able to find documentation anywhere on testing modules that contain OpenResty components.\r\n\r\nFor example:\r\n\r\n```lua\r\nredis = require \"resty.redis\"\r\n\r\n-- rest of lua module I want to test\r\n```\r\n\r\n```\r\nbusted utils.moon\r\n✱\r\n0 successes / 0 failures / 1 error / 0 pending : 0.002996 seconds\r\n\r\nError → utils.moon @ 1\r\nsuite utils.moon\r\nutils.moon:1: module 'resty.redis' not found:\r\n        no field package.preload['resty.redis']\r\n        no file './src/resty/redis.lua'\r\n        no file './src/resty/redis/resty/redis.lua'\r\n        no file './src/resty/redis/init.lua'\r\n        no file '/usr/local/share/lua/5.1/resty/redis.lua'\r\n        no file '/usr/local/share/lua/5.1/resty/redis/init.lua'\r\n        no file '/root/.luarocks/share/lua/5.1/resty/redis.lua'\r\n        no file '/root/.luarocks/share/lua/5.1/resty/redis/init.lua'\r\n        no file '/usr/local/share/lua/5.1/resty/redis.lua'\r\n        no file '/usr/local/share/lua/5.1/resty/redis/init.lua'\r\n        no file '/root/.luarocks/share/lua/5.1/resty/redis.lua'\r\n        no file '/root/.luarocks/share/lua/5.1/resty/redis/init.lua'\r\n        no file '/usr/share/lua/5.1//resty/redis.lua'\r\n        no file '/usr/share/lua/5.1//resty/redis/init.lua'\r\n        no file './resty/redis.lua'\r\n        no file '/usr/local/share/lua/5.1/resty/redis.lua'\r\n        no file '/usr/local/share/lua/5.1/resty/redis/init.lua'\r\n        no file '/usr/local/lib/lua/5.1/resty/redis.lua'\r\n        no file '/usr/local/lib/lua/5.1/resty/redis/init.lua'\r\n        no file '/usr/share/lua/5.1/resty/redis.lua'\r\n        no file '/usr/share/lua/5.1/resty/redis/init.lua'\r\n        no file './csrc/resty/redis.so'\r\n        no file './csrc/resty/redis/resty/redis.so'\r\n        no file '/usr/local/lib/lua/5.1/resty/redis.so'\r\n        no file '/root/.luarocks/lib/lua/5.1/resty/redis.so'\r\n        no file '/usr/local/lib/lua/5.1/resty/redis.so'\r\n        no file '/root/.luarocks/lib/lua/5.1/resty/redis.so'\r\n        no file './resty/redis.so'\r\n        no file '/usr/local/lib/lua/5.1/resty/redis.so'\r\n        no file '/usr/lib/x86_64-linux-gnu/lua/5.1/resty/redis.so'\r\n        no file '/usr/lib/lua/5.1/resty/redis.so'\r\n        no file '/usr/local/lib/lua/5.1/loadall.so'\r\n        no file './csrc/resty.so'\r\n        no file './csrc/resty/resty.so'\r\n        no file '/usr/local/lib/lua/5.1/resty.so'\r\n        no file '/root/.luarocks/lib/lua/5.1/resty.so'\r\n        no file '/usr/local/lib/lua/5.1/resty.so'\r\n        no file '/root/.luarocks/lib/lua/5.1/resty.so'\r\n        no file './resty.so'\r\n        no file '/usr/local/lib/lua/5.1/resty.so'\r\n        no file '/usr/lib/x86_64-linux-gnu/lua/5.1/resty.so'\r\n        no file '/usr/lib/lua/5.1/resty.so'\r\n        no file '/usr/local/lib/lua/5.1/loadall.so'\r\n```\r\n\r\nSeems like it must be a pretty common need to test lapis code that has OpenResty dependencies."}}