use of com.jcabi.github.Repo in project jcabi-github by jcabi.
the class MkRepoTest method works.
/**
* Repo can work.
* @throws Exception If some problem inside
*/
@Test
public void works() throws Exception {
final Repos repos = new MkRepos(new MkStorage.InFile(), "jeff");
final Repo repo = repos.create(new Repos.RepoCreate("test5", false));
MatcherAssert.assertThat(repo.coordinates(), Matchers.hasToString("jeff/test5"));
}
use of com.jcabi.github.Repo in project jcabi-github by jcabi.
the class MkIssueTest method canRememberItsAuthor.
/**
* MkIssue can remember it's author.
* @throws Exception when a problem occurs.
*/
@Test
public void canRememberItsAuthor() throws Exception {
final MkGithub first = new MkGithub("first");
final Github second = first.relogin("second");
final Repo repo = first.randomRepo();
final int number = second.repos().get(repo.coordinates()).issues().create("", "").number();
final Issue issue = first.repos().get(repo.coordinates()).issues().get(number);
MatcherAssert.assertThat(new Issue.Smart(issue).author().login(), Matchers.is("second"));
}
use of com.jcabi.github.Repo in project jcabi-github by jcabi.
the class MkLabelsTest method iteratesLabels.
/**
* MkLabels can list labels.
* @throws Exception If some problem inside
*/
@Test
public void iteratesLabels() throws Exception {
final Repo repo = new MkGithub().randomRepo();
repo.labels().create("bug", "e0e0e0");
MatcherAssert.assertThat(repo.labels().iterate(), Matchers.<Label>iterableWithSize(1));
}
use of com.jcabi.github.Repo in project jcabi-github by jcabi.
the class MkBranchesTest method createsBranch.
/**
* MkBranches can create a new branch.
* @throws IOException if there is any I/O problem
*/
@Test
public void createsBranch() throws IOException {
final String name = "my-new-feature";
final String sha = "590e188e3d52a8da38cf51d3f9bf598bb46911af";
final Repo repo = new MkGithub().randomRepo();
final Branch branch = ((MkBranches) (repo.branches())).create(name, sha);
MatcherAssert.assertThat(branch.name(), Matchers.equalTo(name));
MatcherAssert.assertThat(branch.commit().sha(), Matchers.equalTo(sha));
final Coordinates coords = branch.commit().repo().coordinates();
MatcherAssert.assertThat(coords.user(), Matchers.equalTo(repo.coordinates().user()));
MatcherAssert.assertThat(coords.repo(), Matchers.equalTo(repo.coordinates().repo()));
}
use of com.jcabi.github.Repo in project jcabi-github by jcabi.
the class MkContentTest method canGetOwnRepo.
/**
* MkContent should be able to fetch its own repo.
*
* @throws Exception if some problem inside
*/
@Test
public void canGetOwnRepo() throws Exception {
final Repo repo = new MkGithub().randomRepo();
final Contents contents = repo.contents();
final Content content = contents.create(jsonContent("repo.txt", "for repo", "json repo"));
MatcherAssert.assertThat(content.repo(), Matchers.is(repo));
}
Aggregations