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

honor .as() method on asserts #84

Open
yogurtearl opened this issue Nov 13, 2013 · 1 comment
Open

honor .as() method on asserts #84

yogurtearl opened this issue Nov 13, 2013 · 1 comment

Comments

@yogurtearl
Copy link

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

@JakeWharton
Copy link
Collaborator

👍 Going to be a lot of manual work... we have a lot of assertions!

kriegfrj pushed a commit to kriegfrj/assertj-android that referenced this issue May 16, 2014
…t others can inherit.

-Added assertions that check individual flags rather than insisting on testing all flags in a group.
-Implement Issue square#84 for this class (honor "as()").
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants