Open rybalkinsd opened 4 years ago
cc @neisip
Merging #188 into master will decrease coverage by
5.49%
. The diff coverage is27.50%
.
@@ Coverage Diff @@
## master #188 +/- ##
============================================
- Coverage 90.59% 85.10% -5.50%
- Complexity 127 131 +4
============================================
Files 42 44 +2
Lines 404 443 +39
Branches 49 63 +14
============================================
+ Hits 366 377 +11
- Misses 13 26 +13
- Partials 25 40 +15
Impacted Files | Coverage Δ | Complexity Δ | |
---|---|---|---|
...ithub/rybalkinsd/kohttp/dsl/context/HttpContext.kt | 66.12% <10.00%> (-24.57%) |
15.00 <1.00> (+1.00) |
:arrow_down: |
...hub/rybalkinsd/kohttp/dsl/context/HeaderContext.kt | 63.63% <33.33%> (-36.37%) |
5.00 <1.00> (+1.00) |
:arrow_down: |
...thub/rybalkinsd/kohttp/dsl/context/ParamContext.kt | 71.42% <33.33%> (-28.58%) |
6.00 <1.00> (+1.00) |
:arrow_down: |
...tlin/io/github/rybalkinsd/kohttp/mockk/Matchers.kt | 57.14% <57.14%> (ø) |
1.00 <1.00> (?) |
|
...tlin/io/github/rybalkinsd/kohttp/mockk/Response.kt | 100.00% <100.00%> (ø) |
0.00 <0.00> (?) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update ccf2994...7bd0ac7. Read the comment docs.
Codcov tests are expected to fail now. Will bring more when we will discuss the API
Moved further with mocks. I found other possible declarations for returns statements
every {
httpGet(init = matching {
...
})
} returns ...
Option 2:
returns mockk {
every { code() } returns 42
every { message() } returns ""
}
Pros:
Response
objectsCons:
Option 1 was:
returns Response {
request(mockk())
protocol(mockk())
code(101)
message("...")
}
Will be great to here your thoughts @IVSivak @gokulchandra @DeviantBadge
The first option looks like more commonly used. The second option may be confusing for someone, but it looks concise.