/
ecukes-parse-regular-step-test.el
46 lines (41 loc) · 1.31 KB
/
ecukes-parse-regular-step-test.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
(require 'ecukes-parse)
(ert-deftest parse-regular-step-given ()
"Should parse given step."
(with-parse-step
"given"
(lambda (name head body type arg)
(should (eq type 'regular))
(should (equal name "Given a known state"))
(should (equal body "a known state")))))
(ert-deftest parse-regular-step-when ()
"Should parse when step."
(with-parse-step
"when"
(lambda (name head body type arg)
(should (eq type 'regular))
(should (equal name "When the key action"))
(should (equal body "the key action")))))
(ert-deftest parse-regular-step-then ()
"Should parse then step."
(with-parse-step
"then"
(lambda (name head body type arg)
(should (eq type 'regular))
(should (equal name "Then observe outcomes"))
(should (equal body "observe outcomes")))))
(ert-deftest parse-regular-step-and ()
"Should parse and step."
(with-parse-step
"and"
(lambda (name head body type arg)
(should (eq type 'regular))
(should (equal name "And another key action"))
(should (equal body "another key action")))))
(ert-deftest parse-regular-step-but ()
"Should parse but step."
(with-parse-step
"but"
(lambda (name head body type arg)
(should (eq type 'regular))
(should (eq type 'regular))
(should (equal name "But observe outcomes")))))