Skip to content

Commit 653e10c

Browse files
authored
Merge pull request #25 from rcardin/18-narrow-the-scope-of-assertions-constructor
Fixed constructors scope
2 parents 2432a0b + a5d0ced commit 653e10c

13 files changed

+15
-15
lines changed

src/main/kotlin/in/rcard/assertj/arrowcore/AbstractEitherAssert.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import org.assertj.core.internal.StandardComparisonStrategy
2323
* @since 0.0.1
2424
*/
2525
abstract class AbstractEitherAssert<
26-
SELF : AbstractEitherAssert<SELF, LEFT, RIGHT>, LEFT : Any, RIGHT : Any,
27-
>(
26+
SELF : AbstractEitherAssert<SELF, LEFT, RIGHT>, LEFT : Any, RIGHT : Any,
27+
> internal constructor(
2828
either: Either<LEFT, RIGHT>?,
2929
) : AbstractObjectAssert<SELF, Either<LEFT, RIGHT>>(either, AbstractEitherAssert::class.java) {
3030

src/main/kotlin/in/rcard/assertj/arrowcore/AbstractOptionAssert.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import org.assertj.core.internal.StandardComparisonStrategy
1919
* @since 0.0.1
2020
*/
2121
abstract class AbstractOptionAssert<
22-
SELF : AbstractOptionAssert<SELF, VALUE>, VALUE : Any,
23-
>(
22+
SELF : AbstractOptionAssert<SELF, VALUE>, VALUE : Any,
23+
> internal constructor(
2424
option: Option<VALUE>?,
2525
) : AbstractObjectAssert<SELF, Option<VALUE>>(option, AbstractOptionAssert::class.java) {
2626

src/main/kotlin/in/rcard/assertj/arrowcore/AbstractRaiseAssert.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import org.assertj.core.internal.StandardComparisonStrategy
2020
*/
2121
abstract class AbstractRaiseAssert<
2222
SELF : AbstractRaiseAssert<SELF, ERROR, VALUE>, ERROR : Any, VALUE : Any,
23-
>(lambda: context(Raise<ERROR>) () -> VALUE) :
23+
> internal constructor(lambda: context(Raise<ERROR>) () -> VALUE) :
2424
AbstractAssert<SELF, context(Raise<ERROR>) () -> VALUE>(lambda, AbstractRaiseAssert::class.java) {
2525

2626
private val comparisonStrategy: ComparisonStrategy = StandardComparisonStrategy.instance()

src/main/kotlin/in/rcard/assertj/arrowcore/EitherAssert.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import arrow.core.Either
1010
* @author Riccardo Cardin
1111
* @since 0.0.1
1212
*/
13-
class EitherAssert<LEFT : Any, RIGHT : Any>(either: Either<LEFT, RIGHT>?) :
13+
class EitherAssert<LEFT : Any, RIGHT : Any> private constructor(either: Either<LEFT, RIGHT>?) :
1414
AbstractEitherAssert<EitherAssert<LEFT, RIGHT>, LEFT, RIGHT>(either) {
1515
companion object {
1616
fun <LEFT : Any, RIGHT : Any> assertThat(actual: Either<LEFT, RIGHT>?): EitherAssert<LEFT, RIGHT> =

src/main/kotlin/in/rcard/assertj/arrowcore/OptionAssert.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import arrow.core.Option
99
* @author Riccardo Cardin
1010
* @since 0.0.1
1111
*/
12-
class OptionAssert<VALUE : Any>(option: Option<VALUE>?) :
12+
class OptionAssert<VALUE : Any> private constructor(option: Option<VALUE>?) :
1313
AbstractOptionAssert<OptionAssert<VALUE>, VALUE>(option) {
1414
companion object {
1515
fun <VALUE : Any> assertThat(option: Option<VALUE>?): OptionAssert<VALUE> =

src/main/kotlin/in/rcard/assertj/arrowcore/errors/EitherShouldBeLeft.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import org.assertj.core.error.BasicErrorMessageFactory
99
* @author Riccardo Cardin
1010
* @since 0.0.1
1111
*/
12-
internal class EitherShouldBeLeft(actual: Either<*, *>) :
12+
internal class EitherShouldBeLeft private constructor(actual: Either<*, *>) :
1313
BasicErrorMessageFactory("%nExpecting an Either to be left but was <$actual>.") {
1414
companion object {
1515
internal fun shouldBeLeft(actual: Either<*, *>): EitherShouldBeLeft = EitherShouldBeLeft(actual)

src/main/kotlin/in/rcard/assertj/arrowcore/errors/EitherShouldBeRight.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import org.assertj.core.error.BasicErrorMessageFactory
99
* @author Riccardo Cardin
1010
* @since 0.0.1
1111
*/
12-
internal class EitherShouldBeRight(actual: Either<*, *>) :
12+
internal class EitherShouldBeRight private constructor(actual: Either<*, *>) :
1313
BasicErrorMessageFactory("%nExpecting an Either to be right but was <$actual>.") {
1414
companion object {
1515
internal fun shouldBeRight(actual: Either<*, *>): EitherShouldBeRight = EitherShouldBeRight(actual)

src/main/kotlin/in/rcard/assertj/arrowcore/errors/EitherShouldContain.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import org.assertj.core.error.BasicErrorMessageFactory
99
* @author Riccardo Cardin
1010
* @since 0.0.1
1111
*/
12-
internal class EitherShouldContain(message: String, actual: Either<Any, Any>, expected: Any) :
12+
internal class EitherShouldContain private constructor(message: String, actual: Either<Any, Any>, expected: Any) :
1313
BasicErrorMessageFactory(message, actual, expected) {
1414

1515
companion object {

src/main/kotlin/in/rcard/assertj/arrowcore/errors/EitherShouldContainInstanceOf.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import org.assertj.core.error.BasicErrorMessageFactory
1010
* @author Riccardo Cardin
1111
* @since 0.0.1
1212
*/
13-
internal class EitherShouldContainInstanceOf(message: String) : BasicErrorMessageFactory(message) {
13+
internal class EitherShouldContainInstanceOf private constructor(message: String) : BasicErrorMessageFactory(message) {
1414
companion object {
1515
private const val EXPECTING_TO_CONTAIN_DIFFERENT_INSTANCE =
1616
"%nExpecting:%n <%s>%nto contain a value that is an instance of:%n <%s>%nbut did contain an instance of:%n <%s>"

src/main/kotlin/in/rcard/assertj/arrowcore/errors/OptionShouldBeEmpty.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import org.assertj.core.error.BasicErrorMessageFactory
99
* @author Riccardo Cardin
1010
* @since 0.0.1
1111
*/
12-
internal class OptionShouldBeEmpty(expected: Option<*>) :
12+
internal class OptionShouldBeEmpty private constructor(expected: Option<*>) :
1313
BasicErrorMessageFactory("%nExpecting an Option to be empty but was <%s>.", expected.orNull()) {
1414
companion object {
1515
internal fun shouldBeEmpty(actual: Option<*>): OptionShouldBeEmpty =

0 commit comments

Comments
 (0)