-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from 47deg/rafa-fix-unit-tests
Fixes test
- Loading branch information
Showing
8 changed files
with
71 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,6 @@ language: scala | |
scala: | ||
- 2.11.8 | ||
jdk: | ||
- oraclejdk8 | ||
- oraclejdk8 | ||
script: | ||
- sbt -Dtoken=$GITHUB4S_ACCESS_TOKEN test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/test/scala/com.fortysevendeg.github4s/integration/GHReposSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.fortysevendeg.github4s.integration | ||
|
||
import cats.Id | ||
import cats.scalatest.{XorMatchers, XorValues} | ||
import com.fortysevendeg.github4s.Github._ | ||
import com.fortysevendeg.github4s.GithubResponses._ | ||
import com.fortysevendeg.github4s.free.interpreters.IdInterpreters._ | ||
import com.fortysevendeg.github4s.{Github, TestUtils} | ||
import org.scalatest.{Matchers, FlatSpec} | ||
|
||
|
||
class GHReposSpec extends FlatSpec with Matchers with XorMatchers with XorValues with TestUtils { | ||
|
||
"Repos >> Get" should "return the expected name when valid repo is provided" in { | ||
|
||
val response = Github(accessToken).repos.get(validRepoOwner, validRepoName).exec[Id] | ||
response shouldBe right | ||
response.value.entity.name shouldBe validRepoName | ||
response.value.statusCode shouldBe okStatusCode | ||
} | ||
|
||
it should "return error when an invalid repo name is passed" in { | ||
val response = Github(accessToken).repos.get(validRepoOwner, invalidRepoName).exec[Id] | ||
response shouldBe left | ||
} | ||
|
||
"Repos >> ListCommits" should "return the expected list of commits for valid data" in { | ||
val response = Github(accessToken).repos.listCommits(validRepoOwner, validRepoName).exec[Id] | ||
response shouldBe right | ||
response.value.entity.nonEmpty shouldBe true | ||
response.value.statusCode shouldBe okStatusCode | ||
} | ||
|
||
it should "return error for invalid repo name" in { | ||
val response = Github(accessToken).repos.listCommits(invalidRepoName, validRepoName).exec[Id] | ||
response shouldBe left | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters