Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make PullRequestFile#patch an Option[String] #181

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -50,7 +50,7 @@ case class PullRequestFile(
blob_url: String,
raw_url: String,
contents_url: String,
patch: String,
patch: Option[String],
previous_filename: Option[String])
sealed trait CreatePullRequest {
def head: String
Expand Down
Expand Up @@ -71,6 +71,18 @@ trait GHPullRequestsSpec[T] extends BaseIntegrationSpec[T] {
})
}

"PullRequests >> ListFiles" should "return a right response when a valid repo is provided and not all files have 'patch'" in {
val response =
Github(None).pullRequests
.listFiles("scala", "scala", 4877)
.execFuture[T](headerUserAgent)

testFutureIsRight[List[PullRequestFile]](response, { r =>
r.result.nonEmpty shouldBe true
r.statusCode shouldBe okStatusCode
})
}

it should "return error when an invalid repo name is passed" in {
val response =
Github(accessToken).pullRequests
Expand Down
Expand Up @@ -208,7 +208,7 @@ trait TestData extends DummyGithubUrls {
blob_url = githubApiUrl,
raw_url = githubApiUrl,
contents_url = githubApiUrl,
patch = "",
patch = None,
previous_filename = None
)

Expand Down