org.hamcrest.text
Class IsEqualIgnoringCase

java.lang.Object
  extended by org.hamcrest.BaseMatcher<T>
      extended by org.hamcrest.TypeSafeMatcher<java.lang.String>
          extended by org.hamcrest.text.IsEqualIgnoringCase
All Implemented Interfaces:
org.hamcrest.Matcher<java.lang.String>, org.hamcrest.SelfDescribing

public class IsEqualIgnoringCase
extends org.hamcrest.TypeSafeMatcher<java.lang.String>

Tests if a string is equal to another string, regardless of the case.


Constructor Summary
IsEqualIgnoringCase(java.lang.String string)
           
 
Method Summary
 void describeMismatchSafely(java.lang.String item, org.hamcrest.Description mismatchDescription)
           
 void describeTo(org.hamcrest.Description description)
           
static org.hamcrest.Matcher<java.lang.String> equalToIgnoringCase(java.lang.String expectedString)
          Creates a matcher of String that matches when the examined string is equal to the specified expectedString, ignoring case.
 boolean matchesSafely(java.lang.String item)
           
 
Methods inherited from class org.hamcrest.TypeSafeMatcher
describeMismatch, matches
 
Methods inherited from class org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IsEqualIgnoringCase

public IsEqualIgnoringCase(java.lang.String string)
Method Detail

matchesSafely

public boolean matchesSafely(java.lang.String item)
Specified by:
matchesSafely in class org.hamcrest.TypeSafeMatcher<java.lang.String>

describeMismatchSafely

public void describeMismatchSafely(java.lang.String item,
                                   org.hamcrest.Description mismatchDescription)
Overrides:
describeMismatchSafely in class org.hamcrest.TypeSafeMatcher<java.lang.String>

describeTo

public void describeTo(org.hamcrest.Description description)

equalToIgnoringCase

public static org.hamcrest.Matcher<java.lang.String> equalToIgnoringCase(java.lang.String expectedString)
Creates a matcher of String that matches when the examined string is equal to the specified expectedString, ignoring case.

For example:

assertThat("Foo", equalToIgnoringCase("FOO"))

Parameters:
expectedString - the expected value of matched strings