forked from ecukes/ecukes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecukes-helpers.el
35 lines (30 loc) · 987 Bytes
/
ecukes-helpers.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
;;; ecukes-helpers.el --- Misc helpers
(require 'dash)
(require 'ecukes-def)
(defun ecukes-feature-steps (ecukes-features)
"Return all steps in all FEATURES."
(let* ((scenarios
(-flatten
(-map
(lambda (feature)
(ecukes-feature-scenarios feature)) ecukes-features)))
(backgrounds
(-reject
'null
(-map
(lambda (feature)
(ecukes-feature-background feature)) ecukes-features)))
(scenario-steps
(-map
(lambda (scenario)
(ecukes-scenario-steps scenario)) scenarios))
(background-steps
(-map
(lambda (background)
(ecukes-background-steps background)) backgrounds)))
(-flatten (-concat background-steps scenario-steps))))
(defun ecukes-format-quote (string)
"Quote percent signs in STRING."
(s-replace "%" "%%" string))
(provide 'ecukes-helpers)
;;; ecukes-helpers.el ends here