bodar/yatspec

JUnit assumptions are unsupported

Opened this issue · 0 comments

Hi Dan.

When a JUnit assumption fails yatspec reports that the test has passed and the HTML output is green. It should say something like "Assumption violated" instead and go yellow.

A workaround that we will use for now is assertThat() instead of assumeThat().

An example of a test taht will go green bu should have gone yellow:

import com.googlecode.yatspec.junit.SpecRunner;
import org.junit.Test;
import org.junit.runner.RunWith;

import java.time.ZoneId;

import static org.hamcrest.Matchers.is;
import static org.junit.Assume.assumeThat;

@RunWith(SpecRunner.class)
public class JUnitAssumeTest {
    @Test
    public void assumptionFailsButYatspecHtmlOutputReportsTestPassed() throws Exception {
        assumeThat(ZoneId.systemDefault(), is(ZoneId.of("GMT-12")));
    }
}