public class ScreenShotOnErrorTest {
@Test
public void canTakeScreenShotAndMoveIt() throws IOException {
TakesScreenshot ts = mock(TakesScreenshot.class);
File file = new File(".foo");
file.createNewFile();
file.deleteOnExit();
when(ts.getScreenshotAs(OutputType.FILE)).thenReturn(file);
ScreenShotOnError ssoe = new ScreenShotOnError(ts, ScreenShotOnErrorTest.class, "target/test-classes/", "target/");
ssoe.setContext("baz");
FluentExecutionStopped boo = new FluentExecutionStopped("boo", null);
FluentExecutionStopped bar = ssoe.exceptionDuringExecution(boo, null);