Other readings of a datatable than the vector of maps a step receives.
(defgiven "a book" [state table] (assoc state :book (table/as-map table)))
Each function takes that vector as the step received it: it carries the cells of the feature file in its metadata, header row included, so a table whose first row is not a header - a list, a key/value table - can still be read.
Other readings of a datatable than the vector of maps a step receives.
(defgiven "a book" [state table]
(assoc state :book (table/as-map table)))
Each function takes that vector as the step received it: it carries the cells
of the feature file in its metadata, header row included, so a table whose
first row is not a header - a list, a key/value table - can still be read.(as-list table)A single-column or a single-row table as the vector of its values, first row included.
| admin | | reader | => ["admin" "reader"]
A single-column or a single-row table as the vector of its values, first row included. | admin | | reader | => ["admin" "reader"]
(as-map table)A two-column table as a map: keys from the first column, as keywords like the headers of the vector of maps, values from the second.
| title | Dune | | isbn | 978 | => {:title "Dune" :isbn "978"}
A key written twice throws rather than keep one of the two values.
A two-column table as a map: keys from the first column, as keywords like the
headers of the vector of maps, values from the second.
| title | Dune |
| isbn | 978 | => {:title "Dune" :isbn "978"}
A key written twice throws rather than keep one of the two values.(cells table)The table as the feature file wrote it: a vector of rows, each a vector of strings, the header row first. A vector of maps built by hand, without the parser's metadata, is read back from its keys and values.
The table as the feature file wrote it: a vector of rows, each a vector of strings, the header row first. A vector of maps built by hand, without the parser's metadata, is read back from its keys and values.
(transpose table)A table whose headers are in the first column, read as the vector of maps it would have given with its headers in the first row.
| name | Alice | Bob | | age | 30 | 25 | => [{:name "Alice" :age "30"} {:name "Bob" :age "25"}]
A table whose headers are in the first column, read as the vector of maps it
would have given with its headers in the first row.
| name | Alice | Bob |
| age | 30 | 25 | => [{:name "Alice" :age "30"} {:name "Bob" :age "25"}]cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |