Skip to content

Instantly share code, notes, and snippets.

@nkpart
Created July 30, 2008 05:35
Show Gist options
  • Save nkpart/3232 to your computer and use it in GitHub Desktop.
Save nkpart/3232 to your computer and use it in GitHub Desktop.
This spec passes when it shouldn't. The mockRunnable is never called.
package com.vlc;
import static com.googlecode.instinct.expect.Expect.expect;
import com.googlecode.instinct.integrate.junit4.InstinctRunner;
import com.googlecode.instinct.marker.annotate.Specification;
import org.jmock.Expectations;
import org.junit.runner.RunWith;
@RunWith(InstinctRunner.class)
public final class InstinctFailContext {
private Runnable mockRunnable;
@Specification(expectedException = IllegalArgumentException.class)
public void shouldReportNicerFailsInIntellij() {
expect.that(new Expectations() {
{
one(mockRunnable).run();
}
});
new Thing().foo();
}
private static final class Thing {
public void foo() {
throw new IllegalArgumentException("HERE");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment