Skip to content

Instantly share code, notes, and snippets.

@joelmccracken
Created August 10, 2012 16:56
Show Gist options
  • Save joelmccracken/3315602 to your computer and use it in GitHub Desktop.
Save joelmccracken/3315602 to your computer and use it in GitHub Desktop.
generating data for cucumber tests
;; This buffer is for notes you don't want to save, and for Lisp evaluation.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer.
(progn
(let* ((artists '( "Enterprise Baroque Ensemble"
"Engineering Flute Quartet"
))
(venues '( "Engineering"
"Ten Forward"
"Observation Lounge"
"Holodeck 1"
"Cargo Bay 4"
"Shuttlebay 2"))
(events (apply #'append (mapcar (lambda (venue)
(mapcar (lambda (artist)
(list artist venue))
artists))
venues)))
)
(goto-char (point-max))
(mapcar
(lambda (event)
(insert (format "| %30s | %20s |\n" (car event) (cadr event))))
events)
)
)
| Enterprise Baroque Ensemble | Engineering |
| Engineering Flute Quartet | Engineering |
| Enterprise Baroque Ensemble | Ten Forward |
| Engineering Flute Quartet | Ten Forward |
| Enterprise Baroque Ensemble | Observation Lounge |
| Engineering Flute Quartet | Observation Lounge |
| Enterprise Baroque Ensemble | Holodeck 1 |
| Engineering Flute Quartet | Holodeck 1 |
| Enterprise Baroque Ensemble | Cargo Bay 4 |
| Engineering Flute Quartet | Cargo Bay 4 |
| Enterprise Baroque Ensemble | Shuttlebay 2 |
| Engineering Flute Quartet | Shuttlebay 2 |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment