1+ /*
2+ * Copyright (c) 2016 47 Degrees, LLC. <http://www.47deg.com>
3+ *
4+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
5+ * this software and associated documentation files (the "Software"), to deal in
6+ * the Software without restriction, including without limitation the rights to
7+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8+ * the Software, and to permit persons to whom the Software is furnished to do so,
9+ * subject to the following conditions:
10+ *
11+ * The above copyright notice and this permission notice shall be included in all
12+ * copies or substantial portions of the Software.
13+ *
14+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20+ */
21+
122package github4s .unit
223
3- import github4s .api .{ Auth , Gists , Repos , Users }
24+ import github4s .api .{Auth , Gists , Repos , Users }
425import github4s .free .domain .Pagination
5- import github4s .utils .{ DummyGithubUrls , MockGithubApiServer , TestUtils }
26+ import github4s .utils .{DummyGithubUrls , MockGithubApiServer , TestUtils }
627import org .scalatest ._
728import cats .implicits ._
829
930class ApiSpec
10- extends FlatSpec
11- with Matchers
12- with TestUtils
13- with MockGithubApiServer
14- with DummyGithubUrls {
31+ extends FlatSpec
32+ with Matchers
33+ with TestUtils
34+ with MockGithubApiServer
35+ with DummyGithubUrls {
1536
16- val auth = new Auth
37+ val auth = new Auth
1738 val repos = new Repos
1839 val users = new Users
1940 val gists = new Gists
@@ -29,7 +50,8 @@ class ApiSpec
2950 }
3051
3152 it should " return error on Left when invalid credential is provided" in {
32- val response = auth.newAuth(validUsername, invalidPassword, validScopes, validNote, validClientId, " " )
53+ val response =
54+ auth.newAuth(validUsername, invalidPassword, validScopes, validNote, validClientId, " " )
3355 response should be(' left )
3456 }
3557
@@ -79,9 +101,9 @@ class ApiSpec
79101 " Repos >> ListCommits" should " return the expected list of commits for valid data" in {
80102 val response = repos.listCommits(
81103 accessToken = accessToken,
82- owner = validRepoOwner,
83- repo = validRepoName,
84- pagination = Option (Pagination (validPage, validPerPage))
104+ owner = validRepoOwner,
105+ repo = validRepoName,
106+ pagination = Option (Pagination (validPage, validPerPage))
85107 )
86108 response should be(' right )
87109
@@ -94,9 +116,9 @@ class ApiSpec
94116 it should " return an empty list of commits for invalid page parameter" in {
95117 val response = repos.listCommits(
96118 accessToken = accessToken,
97- owner = validRepoOwner,
98- repo = validRepoName,
99- pagination = Option (Pagination (invalidPage, validPerPage))
119+ owner = validRepoOwner,
120+ repo = validRepoName,
121+ pagination = Option (Pagination (invalidPage, validPerPage))
100122 )
101123
102124 response should be(' right )
@@ -116,8 +138,8 @@ class ApiSpec
116138 " Repos >> ListContributors" should " return the expected list of contributors for valid data" in {
117139 val response = repos.listContributors(
118140 accessToken = accessToken,
119- owner = validRepoOwner,
120- repo = validRepoName
141+ owner = validRepoOwner,
142+ repo = validRepoName
121143 )
122144
123145 response should be(' right )
@@ -132,9 +154,9 @@ class ApiSpec
132154 it should " return the expected list of contributors for valid data, including a valid anon parameter" in {
133155 val response = repos.listContributors(
134156 accessToken = accessToken,
135- owner = validRepoOwner,
136- repo = validRepoName,
137- anon = Option (validAnonParameter)
157+ owner = validRepoOwner,
158+ repo = validRepoName,
159+ anon = Option (validAnonParameter)
138160 )
139161
140162 response should be(' right )
@@ -148,9 +170,9 @@ class ApiSpec
148170 it should " return an empty list of contributors for invalid anon parameter" in {
149171 val response = repos.listContributors(
150172 accessToken = accessToken,
151- owner = validRepoOwner,
152- repo = validRepoName,
153- anon = Some (invalidAnonParameter)
173+ owner = validRepoOwner,
174+ repo = validRepoName,
175+ anon = Some (invalidAnonParameter)
154176 )
155177
156178 response should be(' right )
@@ -222,7 +244,8 @@ class ApiSpec
222244 }
223245
224246 " Gists >> PostGist" should " return the provided gist for a valid request" in {
225- val response = gists.newGist(validGistDescription, validGistPublic, validGistFiles, accessToken)
247+ val response =
248+ gists.newGist(validGistDescription, validGistPublic, validGistFiles, accessToken)
226249 response should be(' right )
227250
228251 response.toOption map { r ⇒
0 commit comments