Skip to content

Instantly share code, notes, and snippets.

@irof
Created August 3, 2012 13:40
Show Gist options
  • Save irof/3247792 to your computer and use it in GitHub Desktop.
Save irof/3247792 to your computer and use it in GitHub Desktop.
GroovyでJUnit
@Grab('junit:junit:4.10')
import org.junit.*
public class HogeTest {
@Test
public void ふつうのテスト() {
assert 1 == 2
}
@Test
public void 失敗すると、こー() {
assert 1 == 2
}
@Test
public void "1とか数字始まりも囲えば良いよね"() {
assert 1 == 1
}
}
JUnit 4 Runner, Tests: 3, Failures: 2, Time: 16
Test Failure: 失敗すると、こー(HogeTest)
Assertion failed:
assert 1 == 2
|
false
at org.codehaus.groovy.runtime.InvokerHelper.assertFailed(InvokerHelper.java:386)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.assertFailed(ScriptBytecodeAdapter.java:658)
at HogeTest.失敗すると、こー(ConsoleScript15:13)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment