1
2
3
4
5 package com.jcabi.github;
6
7 import com.jcabi.aspects.Immutable;
8 import java.io.IOException;
9 import org.hamcrest.MatcherAssert;
10 import org.hamcrest.Matchers;
11 import org.junit.jupiter.api.Test;
12
13
14
15
16
17
18 @Immutable
19 @OAuthScope(OAuthScope.Scope.REPO)
20 final class RtGitignoresITCase {
21
22 @Test
23 void iterateTemplateNames() throws IOException {
24 final Gitignores gitignores = RtGitignoresITCase.gitignores();
25 MatcherAssert.assertThat(
26 "Collection does not contain expected item",
27 gitignores.iterate(),
28 Matchers.hasItem("C++")
29 );
30 }
31
32 @Test
33 void getRawTemplateByName() throws IOException {
34 final Gitignores gitignores = RtGitignoresITCase.gitignores();
35 MatcherAssert.assertThat(
36 "String does not contain expected value",
37 gitignores.template("C"),
38 Matchers.containsString("#")
39 );
40 }
41
42
43
44
45
46 private static Gitignores gitignores() {
47 return new RtGitignores(GitHubIT.connect());
48 }
49 }