-
-
Save TannerRogalsky/b56bc886811f8f0a9d2a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local GithubIssue = {} | |
local http = require("socket.http") | |
function GithubIssue.get(owner, repo) | |
local response, status_code, headers, status = http.request("github.com/repos/" .. owner .. "/" .. repo .. "/issues") | |
return response | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe("GithubIssue", function() | |
it("get function returns json", function() | |
local old_get = Github.get | |
Github.get = function() | |
return "..." -- from this: http://developer.github.com/v3/issues/#list-issues-for-a-repository | |
end | |
assert.is.truthy(GithubIssue.get(1, 2)) | |
end) | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment