diff options
author | Lars Wirzenius <liw@liw.fi> | 2019-10-20 18:43:10 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2019-10-20 18:43:10 +0300 |
commit | ed60b681851b4383578b780b8b29bd83025c9385 (patch) | |
tree | 2b09b9c9e70b2734706166ee97725a4b99321bb1 /src/steps.rs | |
parent | ea58fa14014edb9028f62db23064998680425f12 (diff) | |
download | subplot-ed60b681851b4383578b780b8b29bd83025c9385.tar.gz |
Add: module for representing parsed scenario step
Diffstat (limited to 'src/steps.rs')
-rw-r--r-- | src/steps.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/steps.rs b/src/steps.rs new file mode 100644 index 0000000..c8b4a27 --- /dev/null +++ b/src/steps.rs @@ -0,0 +1,30 @@ +/// A parsed scenario step. +pub struct ScenarioStep { + kind: StepKind, + text: String, +} + +impl ScenarioStep { + pub fn new(kind: StepKind, text: &str) -> ScenarioStep { + ScenarioStep { + kind: kind, + text: text.to_owned(), + } + } + + pub fn kind(&self) -> StepKind { + self.kind + } + + pub fn text(&self) -> &str { + &self.text + } +} + +/// The kind of step we have. +#[derive(Clone,Copy)] +pub enum StepKind { + Given, + When, + Then, +} |