summaryrefslogtreecommitdiff
path: root/src/parser.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.rs')
-rw-r--r--src/parser.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/parser.rs b/src/parser.rs
index 39faab2..35cb488 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -4,7 +4,7 @@
/// Each logical line forms a scenario step. It may be divided into
/// multiple physical lines.
pub fn parse_scenario_snippet(snippet: &str) -> impl Iterator<Item = &str> {
- snippet.lines()
+ snippet.lines().filter(|line| !line.trim().is_empty())
}
#[cfg(test)]
@@ -32,4 +32,12 @@ mod test {
vec!["given I am Tomjon", "when I declare myself king"]
)
}
+
+ #[test]
+ fn parses_two_lines_with_empty_line() {
+ assert_eq!(
+ parse_lines("given I am Tomjon\n\nwhen I declare myself king"),
+ vec!["given I am Tomjon", "when I declare myself king"]
+ )
+ }
}