Examples of Repo


Examples of com.jcabi.github.Repo

     *
     * @throws Exception when a problem occurs.
     */
    @Test
    public void canGetCommentsNumberIfNonZero() throws Exception {
        final Repo repo =  MkPullTest.repo();
        final Pull pull = repo.pulls().create("", "", "");
        pull.comments().post("comment1", "path1", "how are you?", 1);
        pull.comments().post("comment2", "path2", "how are you2?", 2);
        MatcherAssert.assertThat(
            pull.json().getInt("comments"),
            Matchers.is(2)
View Full Code Here

Examples of com.jcabi.github.Repo

     *
     * @throws Exception when a problem occurs.
     */
    @Test
    public void canGetComments() throws Exception {
        final Repo repo =  MkPullTest.repo();
        final Pull pull = repo.pulls().create("", "", "");
        MatcherAssert.assertThat(
            pull.comments(),
            Matchers.notNullValue()
        );
    }
View Full Code Here

Examples of com.jcabi.github.Repo

     * MkReferences can iterate over references.
     * @throws Exception - If something goes wrong.
     */
    @Test
    public void iteratesReferences() throws Exception {
        final Repo owner = this.repo();
        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)
View Full Code Here

Examples of com.jcabi.github.Repo

     * MkReferences can iterate over references in sub-namespace.
     * @throws Exception - If something goes wrong.
     */
    @Test
    public void iteratesReferencesInSubNamespace() throws Exception {
        final Repo owner = this.repo();
        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)
View Full Code Here

Examples of com.jcabi.github.Repo

     * MkReferences can iterate over references in Tagsub-namespace.
     * @throws Exception - If something goes wrong.
     */
    @Test
    public void iteratesTags() throws Exception {
        final Repo owner = this.repo();
        final References refs = owner.git().references();
        refs.create("refs/tags/t2", "2322f34");
        MatcherAssert.assertThat(
            refs.tags(),
            Matchers.<Reference>iterableWithSize(1)
        );
View Full Code Here

Examples of com.jcabi.github.Repo

     * MkReferences can iterate over references in Tagsub-namespace.
     * @throws Exception - If something goes wrong.
     */
    @Test
    public void iteratesHeads() throws Exception {
        final Repo owner = this.repo();
        final References refs = owner.git().references();
        refs.create("refs/heads/branch2", "blahblah");
        MatcherAssert.assertThat(
            refs.heads(),
            Matchers.<Reference>iterableWithSize(1)
        );
View Full Code Here

Examples of com.jcabi.github.Repo

     * MkReferences can remove a Reference.
     * @throws Exception - If something goes wrong.
     */
    @Test
    public void removesReference() throws Exception {
        final Repo owner = this.repo();
        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)
View Full Code Here

Examples of com.jcabi.github.Repo

     * MkLabels can list labels.
     * @throws Exception If some problem inside
     */
    @Test
    public void iteratesLabels() throws Exception {
        final Repo repo = this.repo();
        repo.labels().create("bug", "e0e0e0");
        MatcherAssert.assertThat(
            repo.labels().iterate(),
            Matchers.<Label>iterableWithSize(1)
        );
    }
View Full Code Here

Examples of com.jcabi.github.Repo

     * MkLabels can delete labels.
     * @throws Exception If some problem inside
     */
    @Test
    public void deletesLabels() throws Exception {
        final Repo repo = this.repo();
        final Labels labels = repo.labels();
        final String name = "label-0";
        labels.create(name, "e1e1e1");
        final Issue issue = repo.issues().create("hey, you!", "");
        issue.labels().add(Collections.singletonList(name));
        labels.delete(name);
        MatcherAssert.assertThat(
            repo.labels().iterate(),
            Matchers.emptyIterable()
        );
        MatcherAssert.assertThat(
            issue.labels().iterate(),
            Matchers.emptyIterable()
View Full Code Here

Examples of com.jcabi.github.Repo

     * MkLabels can set label color.
     * @throws Exception If some problem inside
     */
    @Test
    public void setsLabelColor() throws Exception {
        final Repo repo = this.repo();
        final String color = "f0f0f0";
        final String name = "task";
        repo.labels().create(name, color);
        MatcherAssert.assertThat(
            new Label.Smart(repo.labels().get(name)).color(),
            Matchers.equalTo(color)
        );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.