Skip to content
This repository has been archived by the owner on May 19, 2023. It is now read-only.

Commit

Permalink
apidoc: better test (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
dawidd6 authored Jul 31, 2020
1 parent 6394680 commit c18bfce
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Formula/apidoc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def install
(testpath/"api.go").write <<~EOS
/**
* @api {get} /user/:id Request User information
* @apiVersion #{version}
* @apiName GetUser
* @apiGroup User
*
Expand All @@ -35,6 +36,16 @@ def install
* @apiSuccess {String} lastname Lastname of the User.
*/
EOS
(testpath/"apidoc.json").write <<~EOS
{
"name": "example",
"version": "#{version}",
"description": "A basic apiDoc example"
}
EOS
system bin/"apidoc", "-o", "out"
api_data_json = (testpath/"out/api_data.json").read
api_data = JSON.parse api_data_json
assert_equal api_data.first["version"], version
end
end

0 comments on commit c18bfce

Please sign in to comment.