Search in sources :

Example 6 with References

use of com.jcabi.github.References in project jcabi-github by jcabi.

the class MkReferencesTest method iteratesReferencesInSubNamespace.

/**
 * MkReferences can iterate over references in sub-namespace.
 * @throws Exception - If something goes wrong.
 */
@Test
public void iteratesReferencesInSubNamespace() throws Exception {
    final Repo owner = new MkGithub().randomRepo();
    final References refs = owner.git().references();
    refs.create("refs/heads/br", "qweqwe");
    refs.create("refs/tags/t1", "111t222");
    MatcherAssert.assertThat(refs.iterate("heads"), Matchers.<Reference>iterableWithSize(1));
    MatcherAssert.assertThat(refs.iterate("tags"), Matchers.<Reference>iterableWithSize(1));
}
Also used : Repo(com.jcabi.github.Repo) References(com.jcabi.github.References) Test(org.junit.Test)

Example 7 with References

use of com.jcabi.github.References in project jcabi-github by jcabi.

the class MkReferencesTest method iteratesHeads.

/**
 * MkReferences can iterate over references in Tagsub-namespace.
 * @throws Exception - If something goes wrong.
 */
@Test
public void iteratesHeads() throws Exception {
    final Repo owner = new MkGithub().randomRepo();
    final References refs = owner.git().references();
    refs.create("refs/heads/branch2", "blahblah");
    MatcherAssert.assertThat(refs.heads(), Matchers.<Reference>iterableWithSize(1));
}
Also used : Repo(com.jcabi.github.Repo) References(com.jcabi.github.References) Test(org.junit.Test)

Aggregations

References (com.jcabi.github.References)7 Test (org.junit.Test)7 Repo (com.jcabi.github.Repo)5