Skip to content

JUnit assumptions are unsupported #34

@wojciechbulaty

Description

@wojciechbulaty

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")));
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions