Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

honor .as() method on asserts #84

@yogurtearl

Description

@yogurtearl

Update various asserts to honor descriptions passed to "as".

E.g.

assertThat(fooView).as("Foo").isGone()

would print:

Expected Foo to be gone but was visible

For example isGone would contain would be roughly ( based on your current code ):

assertThat(actualVisibility) 
        .overridingErrorMessage("Expected " +
        getWritableAssertionInfo().getDescriptionText() 
             + " to be gone but was %s",
            visibilityToString(actualVisibility)) 
        .isEqualTo(GONE);

Reference:

https://github.com/alexruiz/fest-assert-2.x/blob/fest-assert-core-2.0M10/src/main/java/org/fest/assertions/api/AbstractAssert.java

https://github.com/alexruiz/fest-assert-2.x/blob/fest-assert-core-2.0M10/src/main/java/org/fest/assertions/core/WritableAssertionInfo.java

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions