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

Added mockkStatic hard reference support #518

Merged
merged 1 commit into from Nov 23, 2020
Merged

Added mockkStatic hard reference support #518

merged 1 commit into from Nov 23, 2020

Conversation

gmazzo
Copy link
Contributor

@gmazzo gmazzo commented Oct 30, 2020

Adds a jvm-only mockkStatic overload function that will allow passing a function reference to pick up the declaringClass.

This allows to write more robust tests as hardocded class references like:

// declared in File.kt ("pkg" package)
fun Obj.extensionFunc() = value + 5

mockkStatic("pkg.FileKt")

Can now be just:

// declared in File.kt ("pkg" package)
fun Obj.extensionFunc() = value + 5

mockkStatic(Obj::extensionFunc)

.travis.yml Outdated Show resolved Hide resolved
@gmazzo
Copy link
Contributor Author

gmazzo commented Nov 23, 2020

I've fixed the conflicts, any feedback from this @Raibaz ?

@codecov-io
Copy link

Codecov Report

Merging #518 (8befb6f) into master (028afca) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #518   +/-   ##
=========================================
  Coverage     72.79%   72.79%           
  Complexity      777      777           
=========================================
  Files            99       99           
  Lines          2764     2764           
  Branches        431      431           
=========================================
  Hits           2012     2012           
  Misses          577      577           
  Partials        175      175           

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 028afca...8befb6f. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants