Skip to content

Commit

Permalink
Added databinding for files
Browse files Browse the repository at this point in the history
  • Loading branch information
kohsuke committed May 10, 2014
1 parent 2ddb401 commit 688d8ed
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/org/kohsuke/github/GHGistFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* A file inside {@link GHGist}
*
* @author Kohsuke Kawaguchi
* @see GHGist#getFile(String)
* @see GHGist#getFiles()
*/
public class GHGistFile {
/*package almost final*/ String fileName;
Expand Down
15 changes: 15 additions & 0 deletions src/test/java/org/kohsuke/github/GistTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,19 @@ public void starTest() throws Exception {
newGist.delete();
}
}

@Test
public void gistFile() throws Exception {
GHGist gist = gitHub.getGist("9903708");

assertTrue(gist.isPublic());

assertEquals(1,gist.getFiles().size());
GHGistFile f = gist.getFile("keybase.md");

assertEquals("text/plain", f.getType());
assertEquals("Markdown", f.getLanguage());
assertTrue(f.getContent().contains("### Keybase proof"));
assertNotNull(f.getContent());
}
}

0 comments on commit 688d8ed

Please sign in to comment.