@@ -15,42 +15,34 @@ class GitHubEventSpec extends FunSpec with Matchers with Inside
15
15
it(" should yield IssueEvent" ) {
16
16
event shouldBe a [IssueEvent ]
17
17
}
18
- it( " should have a name " ) {
18
+ describe( " IssueEvent " ) {
19
19
inside(event) {
20
20
case e @ IssueEvent (name, _) =>
21
- assert(name === " issue" )
22
- }
23
- }
24
- it(" should have an action" ) {
25
- inside(event) {
26
- case e @ IssueEvent (_, _) =>
27
- assert(e.action === models.IssueAction .opened)
28
- }
29
- }
30
- it(" should have an issue" ) {
31
- inside(event) {
32
- case e @ IssueEvent (_, _) =>
33
- e.issue shouldBe a [models.Issue ]
34
- }
35
- }
36
- describe(" Issue" ) {
37
- inside(event) {
38
- case e @ IssueEvent (_, _) => {
39
- val issue = e.issue
40
- it(" should have a number" ) {
41
- assert(issue.number === 2l )
21
+ it(" should have a name" ) {
22
+ assert(name === " issue" )
42
23
}
43
- it(" should have a title " ) {
44
- assert(issue.title === " Spelling error in the README file " )
24
+ it(" should have an action " ) {
25
+ assert(e.action === models. IssueAction .opened )
45
26
}
46
- it(" should have a state " ) {
47
- assert(issue.state === " open " )
27
+ it(" should have an issue " ) {
28
+ e.issue shouldBe a [models. Issue ]
48
29
}
49
- it(" should have a body" ) {
50
- val exp = " It looks like you accidently spelled 'commit' with two 't's."
51
- assert(issue.body === Some (exp))
30
+ describe(" Issue" ) {
31
+ val issue = e.issue
32
+ it(" should have a number" ) {
33
+ assert(issue.number === 2l )
34
+ }
35
+ it(" should have a title" ) {
36
+ assert(issue.title === " Spelling error in the README file" )
37
+ }
38
+ it(" should have a state" ) {
39
+ assert(issue.state === " open" )
40
+ }
41
+ it(" should have a body" ) {
42
+ val exp = " It looks like you accidently spelled 'commit' with two 't's."
43
+ assert(issue.body === Some (exp))
44
+ }
52
45
}
53
- }
54
46
}
55
47
}
56
48
}
@@ -61,72 +53,61 @@ class GitHubEventSpec extends FunSpec with Matchers with Inside
61
53
it(" should yield PullRequestEvent" ) {
62
54
event shouldBe a [PullRequestEvent ]
63
55
}
64
- it(" should have a name" ) {
65
- inside(event) {
66
- case e @ PullRequestEvent (name, _) =>
67
- assert(name === " pull_request" )
68
- }
69
- }
70
- it(" should have a number" ) {
71
- inside(event) {
72
- case e @ PullRequestEvent (_, _) =>
73
- assert(e.number === 1l )
74
- }
75
- }
76
- it(" should have an action" ) {
77
- inside(event) {
78
- case e @ PullRequestEvent (_, _) =>
79
- assert(e.action === models.PullRequestAction .opened)
80
- }
81
- }
82
- it(" should have a pull request" ) {
83
- inside(event) {
84
- case e @ PullRequestEvent (_, _) =>
85
- e.pull_request shouldBe a [models.PullRequest ]
86
- }
87
- }
88
56
describe(" PullRequest" ) {
89
57
inside(event) {
90
- case e @ PullRequestEvent (_, _) => {
91
- val pr = e.pull_request
92
- it(" should have a number" ) {
93
- assert(pr.number === 1l )
94
- }
95
- it(" should have a title" ) {
96
- assert(pr.title === " Update the README with new information" )
58
+ case e @ PullRequestEvent (name, _) =>
59
+ it(" should have a name" ) {
60
+ assert(name === " pull_request" )
97
61
}
98
- it(" should have a state " ) {
99
- assert(pr.state === " open " )
62
+ it(" should have a number " ) {
63
+ assert(e.number === 1l )
100
64
}
101
- it(" should have a body" ) {
102
- val exp = " This is a pretty simple change that we need to pull into master."
103
- assert(pr.body === exp)
65
+ it(" should have an action" ) {
66
+ assert(e.action === models.PullRequestAction .opened)
104
67
}
105
- it(" should have a head " ) {
106
- pr.head shouldBe a [models.PullRequestRef ]
68
+ it(" should have a pull request " ) {
69
+ e.pull_request shouldBe a [models.PullRequest ]
107
70
}
108
- describe(" PullRequestRef " ) {
109
- val head = pr.head
110
- it(" should have a label " ) {
111
- assert(head.label === " baxterthehacker:changes " )
71
+ describe(" PullRequest " ) {
72
+ val pr = e.pull_request
73
+ it(" should have a number " ) {
74
+ assert(pr.number === 1l )
112
75
}
113
- it(" should have a ref " ) {
114
- assert(head.ref === " changes " )
76
+ it(" should have a title " ) {
77
+ assert(pr.title === " Update the README with new information " )
115
78
}
116
- it(" should have a sha " ) {
117
- assert(head.sha === " 0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c " )
79
+ it(" should have a state " ) {
80
+ assert(pr.state === " open " )
118
81
}
119
- it(" should have a user" ) {
120
- head.user shouldBe a [models.User ]
82
+ it(" should have a body" ) {
83
+ val exp = " This is a pretty simple change that we need to pull into master."
84
+ assert(pr.body === exp)
121
85
}
122
- it(" should have a repo" ) {
123
- head.repo shouldBe a [models.Repository ]
86
+ it(" should have a head" ) {
87
+ pr.head shouldBe a [models.PullRequestRef ]
88
+ }
89
+ describe(" PullRequestRef" ) {
90
+ val head = pr.head
91
+ it(" should have a label" ) {
92
+ assert(head.label === " baxterthehacker:changes" )
93
+ }
94
+ it(" should have a ref" ) {
95
+ assert(head.ref === " changes" )
96
+ }
97
+ it(" should have a sha" ) {
98
+ assert(head.sha === " 0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c" )
99
+ }
100
+ it(" should have a user" ) {
101
+ head.user shouldBe a [models.User ]
102
+ }
103
+ it(" should have a repo" ) {
104
+ head.repo shouldBe a [models.Repository ]
105
+ }
106
+ }
107
+ it(" should have a base" ) {
108
+ pr.base shouldBe a [models.PullRequestRef ]
124
109
}
125
110
}
126
- it(" should have a base" ) {
127
- pr.base shouldBe a [models.PullRequestRef ]
128
- }
129
- }
130
111
}
131
112
}
132
113
}
0 commit comments