Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rft - use commons-lang3 to format duration with words instead of millis
for example: `<120 000L> milliseconds` now became as `2 minutes`
- Loading branch information
MerkushevKirill
committed
Sep 30, 2014
1 parent
35c8e6a
commit cd616e7
Showing
2 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...her-decorators/src/test/java/ru/yandex/qatools/matchers/decorators/TimeoutWaiterTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package ru.yandex.qatools.matchers.decorators; | ||
|
||
import org.hamcrest.StringDescription; | ||
import org.junit.Test; | ||
|
||
import java.util.concurrent.TimeUnit; | ||
|
||
import static org.hamcrest.MatcherAssert.assertThat; | ||
import static org.hamcrest.Matchers.equalTo; | ||
|
||
/** | ||
* User: lanwen | ||
* Date: 30.09.14 | ||
* Time: 17:52 | ||
*/ | ||
public class TimeoutWaiterTest { | ||
|
||
@Test | ||
public void shouldReturn30SecondsDescriptionByDefault() throws Exception { | ||
StringDescription description = new StringDescription(); | ||
TimeoutWaiter.timeoutHasExpired().describeTo(description); | ||
|
||
assertThat("Should format 30 seconds by default", description.toString(), equalTo("30 seconds")); | ||
} | ||
|
||
@Test | ||
public void shouldReturnMinutesInDescription() throws Exception { | ||
StringDescription description = new StringDescription(); | ||
TimeoutWaiter.timeoutHasExpired(TimeUnit.MINUTES.toMillis(2)).describeTo(description); | ||
|
||
assertThat("Should format millis as minutes if can", description.toString(), equalTo("2 minutes")); | ||
} | ||
} |