Skip to content

Commit

Permalink
Exclude RandomProvider from FakerIT and cli/Introspector tests
Browse files Browse the repository at this point in the history
  • Loading branch information
serpro69 committed Feb 11, 2024
1 parent 903c50d commit 0e3afd0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
.[1.16.0] - UNRELEASED
[%collapsible]
====
[discrete]
=== Breaking Change

* https://github.com/serpro69/kotlin-faker/pull/213[#213] [core] Add support for unique data generation to `Faker#random`

[discrete]
=== Added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package io.github.serpro69.kfaker.app.cli

import io.github.serpro69.kfaker.Faker
import io.github.serpro69.kfaker.provider.FakeDataProvider
import io.github.serpro69.kfaker.provider.misc.RandomProvider
import io.github.serpro69.kfaker.provider.misc.StringProvider
import kotlin.reflect.KFunction
import kotlin.reflect.KProperty
Expand All @@ -20,6 +21,7 @@ class Introspector(private val faker: Faker) {
it.visibility == KVisibility.PUBLIC
&& it.returnType.isSubtypeOf(FakeDataProvider::class.starProjectedType)
&& it.returnType.classifier != StringProvider::class // Ignore this one as it's "special"
&& it.returnType.classifier != RandomProvider::class // Ignore this one as it's "special"
}

// Get a list of all publicly visible functions and sub-provider properties in each provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package io.github.serpro69.kfaker

import io.github.serpro69.kfaker.provider.FakeDataProvider
import io.github.serpro69.kfaker.provider.Money
import io.github.serpro69.kfaker.provider.misc.RandomProvider
import io.github.serpro69.kfaker.provider.misc.StringProvider
import io.kotest.assertions.assertSoftly
import io.kotest.core.spec.style.DescribeSpec
Expand All @@ -26,6 +27,7 @@ class FakerIT : DescribeSpec({
&& it.returnType.isSubtypeOf(FakeDataProvider::class.starProjectedType)
&& it.returnType.classifier != Money::class // Ignore Money provider as it's a special case
&& it.returnType.classifier != StringProvider::class // Ignore String provider
&& it.returnType.classifier != RandomProvider::class // Ignore String provider
}

// Get a list of all publicly visible functions in each provider
Expand Down

0 comments on commit 0e3afd0

Please sign in to comment.