Skip to content

Commit 8f62cb4

Browse files
committedFeb 7, 2017
Fix case of SearchCodeItems and rename repository member
1 parent cbbc8b6 commit 8f62cb4

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed
 

Diff for: ‎src/main/scala/codecheck/github/models/Search.scala

+4-4
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,16 @@ case class SearchCodeInput (
8282
order: SortDirection = SortDirection.desc
8383
) extends SearchInput
8484

85-
case class searchCodeItems (value: JValue) extends AbstractJson(value){
85+
case class SearchCodeItems (value: JValue) extends AbstractJson(value){
8686
def name: String = get("name")
87-
lazy val Repo = new Repository(value \ "repository")
87+
lazy val repository = Repository(value \ "repository")
8888
}
8989

9090
case class SearchCodeResult(value: JValue) extends AbstractJson(value) {
9191
def total_count: Long = get("total_count").toLong
9292
def incomplete_results: Boolean = boolean("incomplete_results")
9393
lazy val items = (value \ "items") match {
94-
case JArray(arr) => arr.map(new searchCodeItems(_))
94+
case JArray(arr) => arr.map(SearchCodeItems(_))
9595
case _ => Nil
9696
}
9797
}
@@ -106,7 +106,7 @@ case class SearchIssueResult(value: JValue) extends AbstractJson(value) {
106106
def total_count: Long = get("total_count").toLong
107107
def incomplete_results: Boolean = boolean("incomplete_results")
108108
lazy val items = (value \ "items") match {
109-
case JArray(arr) => arr.map(new Issue(_))
109+
case JArray(arr) => arr.map(Issue(_))
110110
case _ => Nil
111111
}
112112
}

Diff for: ‎src/test/scala/SearchOpSpec.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import codecheck.github.models.SearchIssueSort
1212
import codecheck.github.models.SearchUserSort
1313
import codecheck.github.models.SearchRepositoryResult
1414
import codecheck.github.models.SearchCodeResult
15-
import codecheck.github.models.searchCodeItems
15+
import codecheck.github.models.SearchCodeItems
1616
import codecheck.github.exceptions.GitHubAPIException
1717

1818
class SearchOpSpec extends FunSpec
@@ -54,8 +54,8 @@ class SearchOpSpec extends FunSpec
5454
val input = SearchCodeInput(q1,sort=None,order=SortDirection.desc)
5555
val res = Await.result(api.searchCode(input), TIMEOUT)
5656
assert(res.total_count >= 1)
57-
assert(res.items(0).Repo.id >= 1 )
58-
assert(res.items(0).Repo.full_name == "jquery/jquery")
57+
assert(res.items(0).repository.id >= 1 )
58+
assert(res.items(0).repository.full_name == "jquery/jquery")
5959
}
6060
//Following test results in error:
6161
// "message" : "Validation Failed",

0 commit comments

Comments
 (0)
Please sign in to comment.