Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Our results for assertContains make no sense #257

Open
irinamok opened this issue Apr 20, 2012 · 3 comments
Open

Our results for assertContains make no sense #257

irinamok opened this issue Apr 20, 2012 · 3 comments
Assignees
Labels
Milestone

Comments

@irinamok
Copy link
Contributor

assertContains (logger.getText(), "Action event on button#copy");

produces the following result:

Actual value: "Action event on button#copy"
Expected value: "[16:54:41] Action event on button"
Message: null

which makes no sense because expected value is "Action event on button#copy", and actual is what is retrieved from logger.getText().

We have to either: change the order of arguments in assertContains or fix results reporting for assertContains API

@ghost ghost assigned zacharyc Apr 20, 2012
@eliseosoto
Copy link
Collaborator

IIRC the order was changed because assertContains is primarily used for arrays. There was a reason for this change but I don't remember exactly what was it. Any comments @zacharyc?

It looks like you want to assert if a substring is contained inside another string. Should we have another assert to make this clearer? Something like assertStringContains() maybe?

@zacharyc
Copy link
Collaborator

The first suggestion makes no sense. Expected and Actual have no meaning in the function assertContains so switching the order really does nothing. We have to fix our reporting algorithm to do parameter inspection or something like that to come up with better names.

@zacharyc
Copy link
Collaborator

Changing the order name of the function does not remove the problem that terms actual and expected do not make sense in the context of assertContains. We need to find a better way to do this.

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

No branches or pull requests

3 participants