@@ -27,37 +27,38 @@ import net.avh4.test.junit.Nested;
27
27
28
28
@RunWith (Nested . class)
29
29
public class QueueTest {
30
- private Queue<String > subject;
31
-
32
- @Before
33
- public void setUp () {
34
- subject = new Queue<String > ();
35
- }
36
-
37
- @Test
38
- public void push_shouldIncreaseCount () {
39
- subject. push(" Item" );
40
- assertThat(subject. count(), is(1 ));
41
- }
42
-
43
- public class WhenEmpty {
44
- @Test (expected = NoSuchElementException . class)
45
- public void pop_shouldThrow () {
46
- subject. pop();
47
- }
48
- }
30
+ private Queue<String > subject;
49
31
50
- public class WithOneItem {
51
32
@Before
52
33
public void setUp () {
53
- subject. push( " First " );
34
+ subject = new Queue< String > ( );
54
35
}
55
36
56
37
@Test
57
- public void pop_shouldReturnTheItem () {
58
- assertThat(subject. pop(), is(" First" ));
38
+ public void push_shouldIncreaseCount () {
39
+ subject. push(" Item" );
40
+ assertThat(subject. count(), is(1 ));
41
+ }
42
+
43
+ public class WhenEmpty {
44
+ @Test (expected = NoSuchElementException . class)
45
+ public void pop_shouldThrow () {
46
+ subject. pop();
47
+ }
48
+ }
49
+
50
+ public class WithOneItem {
51
+ @Before
52
+ public void setUp () {
53
+ subject. push(" First" );
54
+ }
55
+
56
+ @Test
57
+ public void pop_shouldReturnTheItem () {
58
+ assertThat(subject. pop(), is(" First" ));
59
+ }
59
60
}
60
- }
61
+ }
61
62
```
62
63
63
64
## What works
@@ -76,6 +77,12 @@ public class QueueTest {
76
77
* ` @Rule ` methods (however, @Rule fields do work) for outer classes
77
78
* ` @RunWith ` on inner classes
78
79
80
+ ## License
81
+
82
+ junit-nested is licensed under the [ Common Public License version
83
+ 1.0] ( http://www.opensource.org/licenses/cpl1.0.txt ) . If you have need of a
84
+ different license, please contact me.
85
+
79
86
## References
80
87
81
88
Below are some resources I investigated before writing junit-nested, which
0 commit comments