forked from ecukes/ecukes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecukes-def.el
51 lines (40 loc) · 1.43 KB
/
ecukes-def.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
47
48
49
50
51
;;; ecukes-def.el --- Data structure definitions
(require 'f)
(require 's)
(eval-when-compile (require 'cl))
(defstruct ecukes-feature
"A feature is the top level structure for a feature file."
intro background outlines scenarios)
(defstruct ecukes-intro
"A feature introduction is a description of a feature. It is
optional, but is conventionally included."
header description)
(defstruct ecukes-background
"A feature background is a few steps that are run before each scenario."
steps)
(defstruct ecukes-outline
"A scenario outline contains examples that are used to generate concrete scenarios."
name steps tags table)
(defstruct ecukes-scenario
"A feature scenario is a scenario that is built up by steps."
name steps tags)
(defstruct ecukes-step
"A step is some kind of action."
name head body arg type err status)
(defstruct ecukes-step-def
"A step definition."
regex fn doc file)
(defun ecukes-step-file-name (step &optional relative)
"Return the file in which STEP is defined.
File name is converted to \".el\" if it exists, otherwise
\".elc\" file may be returned. When the second argument RELATIVE
is given, return relative path."
(let* ((file (ecukes-step-def-file step))
(el (when file (s-replace ".elc" ".el" file))))
(when (and el (file-exists-p el))
(setq file el))
(if (and file relative)
(f-relative file)
file)))
(provide 'ecukes-def)
;;; ecukes-def.el ends here