Search in sources :

Example 1 with References

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

the class MkReferencesTest method removesReference.

/**
 * MkReferences can remove a Reference.
 * @throws Exception - If something goes wrong.
 */
@Test
public void removesReference() throws Exception {
    final Repo owner = new MkGithub().randomRepo();
    final References refs = owner.git().references();
    refs.create("refs/heads/testbr", "qweqwe22");
    refs.create("refs/tags/t2", "111teee");
    MatcherAssert.assertThat(refs.iterate(), Matchers.<Reference>iterableWithSize(2));
    refs.remove("refs/tags/t2");
    MatcherAssert.assertThat(refs.iterate(), Matchers.<Reference>iterableWithSize(1));
}
Also used : Repo(com.jcabi.github.Repo) References(com.jcabi.github.References) Test(org.junit.Test)

Example 2 with References

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

the class MkReferencesTest method iteratesReferences.

/**
 * MkReferences can iterate over references.
 * @throws Exception - If something goes wrong.
 */
@Test
public void iteratesReferences() 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(), Matchers.<Reference>iterableWithSize(2));
}
Also used : Repo(com.jcabi.github.Repo) References(com.jcabi.github.References) Test(org.junit.Test)

Example 3 with References

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

the class MkReferencesTest method iteratesTags.

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

Example 4 with References

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

the class MkReferencesTest method returnsRepo.

/**
 * MkReference can return its owner.
 * @throws Exception - If something goes wrong.
 */
@Test
public void returnsRepo() throws Exception {
    final References refs = new MkGithub().randomRepo().git().references();
    MatcherAssert.assertThat(refs.repo(), Matchers.notNullValue());
}
Also used : References(com.jcabi.github.References) Test(org.junit.Test)

Example 5 with References

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

the class MkReferencesTest method createsMkReference.

/**
 * MkReferences can create a MkReference.
 * @throws Exception - If something goes wrong.
 */
@Test
public void createsMkReference() throws Exception {
    final References refs = new MkGithub().randomRepo().git().references();
    MatcherAssert.assertThat(refs.create("refs/heads/branch1", "abcderf122"), Matchers.notNullValue());
}
Also used : 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