Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JUnit assumptions are unsupported #34

Open
wojciechbulaty opened this issue May 31, 2016 · 0 comments
Open

JUnit assumptions are unsupported #34

wojciechbulaty opened this issue May 31, 2016 · 0 comments

Comments

@wojciechbulaty
Copy link
Collaborator

wojciechbulaty commented May 31, 2016

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")));
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant