package org.jmock.internal.matcher;

import java.lang.reflect.Method;

import org.hamcrest.Description;
import org.hamcrest.TypeSafeMatcher;

public class MethodMatcher extends TypeSafeMatcher<Method> {
    private Method expectedMethod;
    
    public MethodMatcher(Method expectedMethod) {
        super(Method.class);
        this.expectedMethod = expectedMethod;
    }
    
    @Override
    protected boolean matchesSafely(Method m) {
        return m == expectedMethod;
    }
    
    public void describeTo(Description description) {
        description.appendText(expectedMethod.getName());
    }
}

@@ -452,13 +452,8 @@
 turn
- m ==
  exp
@@ -455,32 +455,42 @@
 n expectedMethod
+.equals(m)
 ;%0A    %7D%0A    %0A   

fix for JMOCK-126