Skip to content

Commit

Permalink
ASDoc anything()
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbourne committed Jan 5, 2012
1 parent 0275972 commit b00798a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 31 deletions.
55 changes: 25 additions & 30 deletions hamcrest-unit-test/src/org/hamcrest/core/IsAnythingTest.as
Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
package org.hamcrest.core
{

import org.hamcrest.*;

public class IsAnythingTest extends AbstractMatcherTestCase
{

[Test]
public function alwaysEvaluatesToTrue():void
{

assertThat(null, anything());
assertThat(new Object(), anything());
assertThat("hi", anything());
}

[Test]
public function hasUsefulDefaultDescription():void
{

assertDescription("ANYTHING", anything());
}

[Test]
public function canOverrideDescription():void
{

var description:String = "description";
assertDescription(description, anything(description));
}
}
import org.hamcrest.*;

public class IsAnythingTest extends AbstractMatcherTestCase
{
[Test]
public function alwaysEvaluatesToTrue():void
{
assertThat(null, anything());
assertThat(new Object(), anything());
assertThat("hi", anything());
}

[Test]
public function hasUsefulDefaultDescription():void
{
assertDescription("ANYTHING", anything());
}

[Test]
public function canOverrideDescription():void
{
var description:String = "description";
assertDescription(description, anything(description));
}
}
}
8 changes: 7 additions & 1 deletion hamcrest/src/org/hamcrest/core/anything.as
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@ package org.hamcrest.core
import org.hamcrest.Matcher;

/**
* Checks if item being matched is anything, effectively always matches.
* Always matches. Opposite of <code>nothing().</code>
*
* @param message Custom message to use in <code>describeTo</code>
*
* @see org.hamcrest.core.IsAnythingMatcher
* @see org.hamcrest.core#nothing()
*
* @example
* <listing version="3.0">
* // all pass
* assertThat("the great void", anything());
* assertThat(true, anything());
* assertThat(false, anything());
* assertThat({}, anything());
* assertThat(123, anything());
* </listing>
*
* @author Drew Bourne
Expand Down

0 comments on commit b00798a

Please sign in to comment.