Skip to content

Commit 2af0fee

Browse files
authored
Merge pull request exercism#391 from superklamer/robot-name
robot-name: avoid test pollution [Fix exercism#362]
2 parents b47805e + f114759 commit 2af0fee

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎exercises/robot-name/src/test/java/RobotTest.java‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import org.junit.Test;
22
import org.junit.Ignore;
3+
import org.junit.Before;
34

45
import static org.hamcrest.CoreMatchers.equalTo;
56
import static org.hamcrest.core.Is.is;
@@ -9,8 +10,12 @@
910
public class RobotTest {
1011

1112
private static final String EXPECTED_ROBOT_NAME_PATTERN = "[A-Z]{2}\\d{3}";
12-
private final Robot robot = new Robot();
13+
private Robot robot;
1314

15+
@Before
16+
public void setUp() {
17+
robot = new Robot();
18+
}
1419

1520
@Test
1621
public void hasName() {

0 commit comments

Comments
 (0)