Patched LocalizedMatcher due to hamcrest update, (bug upstream)

This commit is contained in:
Tomas Radej 2013-04-05 16:28:28 +02:00
parent bc45bedad9
commit 3261caf4f0
2 changed files with 30 additions and 1 deletions

24
mockito-matcher.patch Normal file
View File

@ -0,0 +1,24 @@
diff --git a/src/org/mockito/internal/matchers/LocalizedMatcher.java b/src/org/mockito/internal/matchers/LocalizedMatcher.java
index 01e83b3..7d249f5 100644
--- a/src/org/mockito/internal/matchers/LocalizedMatcher.java
+++ b/src/org/mockito/internal/matchers/LocalizedMatcher.java
@@ -16,6 +16,12 @@ public class LocalizedMatcher implements Matcher, ContainsExtraTypeInformation,
private final Matcher actualMatcher;
private Location location;
+ /* This is a hack for Fedora. Bug has been filed here:
+ * https://code.google.com/p/mockito/issues/detail?id=428 */
+ public void describeMismatch(Object item, Description mismatchDescription) {
+ mismatchDescription.appendText("was ").appendValue(item);
+ }
+
public LocalizedMatcher(Matcher actualMatcher) {
this.actualMatcher = actualMatcher;
this.location = new Location();
@@ -65,4 +71,4 @@ public class LocalizedMatcher implements Matcher, ContainsExtraTypeInformation,
public Matcher getActualMatcher() {
return actualMatcher;
}
-}
\ No newline at end of file
+}

View File

@ -1,6 +1,6 @@
Name: mockito
Version: 1.9.0
Release: 11%{?dist}
Release: 12%{?dist}
Summary: A Java mocking framework
License: MIT
@ -11,6 +11,7 @@ Patch0: fixup-ant-script.patch
Patch1: fix-cglib-refs.patch
Patch2: maven-cglib-dependency.patch
Patch3: fix-bnd-config.patch
Patch4: %{name}-matcher.patch
BuildArch: noarch
BuildRequires: jpackage-utils
@ -51,6 +52,7 @@ This package contains the API documentation for %{name}.
# Set Bundle-Version properly
sed -i 's/Bundle-Version= ${version}/Bundle-Version= %{version}/' conf/mockito-core.bnd
%patch3
%patch4 -p1
%build
ant jar javadoc
@ -86,6 +88,9 @@ cp -rp target/javadoc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
%doc NOTICE
%changelog
* Mon Mar 25 2013 Tomas Radej <tradej@redhat.com> - 1.9.0-12
- Patched LocalizedMatcher due to hamcrest update, (bug upstream)
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9.0-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild