use of com.jcabi.http.request.FakeRequest in project jcabi-github by jcabi.
the class RtGitTest method canFetchOwnRepo.
/**
* RtGit can fetch its own repo.
*
* @throws Exception If something goes wrong.
*/
@Test
public void canFetchOwnRepo() throws Exception {
final Repo repo = repo();
MatcherAssert.assertThat(new RtGit(new FakeRequest(), repo).repo(), Matchers.is(repo));
}
use of com.jcabi.http.request.FakeRequest in project jcabi-github by jcabi.
the class RtGithubTest method equalsToAnotherGithub.
/**
* RtGithub can compare itself with another object.
* @throws Exception if a problem occurs.
*/
@Test
public void equalsToAnotherGithub() throws Exception {
MatcherAssert.assertThat(new RtGithub(new FakeRequest().header("abc", "cde")), Matchers.not(Matchers.equalTo(new RtGithub(new FakeRequest().header("fgh", "ikl")))));
MatcherAssert.assertThat(new RtGithub(new FakeRequest()), Matchers.equalTo(new RtGithub(new FakeRequest())));
}
use of com.jcabi.http.request.FakeRequest in project jcabi-github by jcabi.
the class RtGithubTest method retrievesGists.
/**
* RtGithub can retrieve its gists.
*
* @throws Exception if a problem occurs.
*/
@Test
public void retrievesGists() throws Exception {
final RtGithub github = new RtGithub(new FakeRequest());
MatcherAssert.assertThat(github.gists(), Matchers.notNullValue());
}
use of com.jcabi.http.request.FakeRequest in project jcabi-github by jcabi.
the class RtGitignoresTest method getRawTemplateByName.
/**
* RtGitignores can get raw template by name.
* @throws Exception if there is any error
*/
@Test
public void getRawTemplateByName() throws Exception {
final RtGitignores gitignores = new RtGitignores(new RtGithub(new FakeRequest().withBody("# Object files")));
MatcherAssert.assertThat(gitignores.template("C#"), Matchers.startsWith("# Object"));
}
use of com.jcabi.http.request.FakeRequest in project jcabi-github by jcabi.
the class RtUserTest method checksIfHeHasNoName.
/**
* RtUser can check if he has NO name.
* @throws Exception If some problem inside
*/
@Test
public void checksIfHeHasNoName() throws Exception {
final User.Smart smart = new User.Smart(new RtUser(Mockito.mock(Github.class), new FakeRequest().withBody(Json.createObjectBuilder().build().toString()), "octoc"));
MatcherAssert.assertThat(smart.hasName(), Matchers.equalTo(false));
}
Aggregations