Skip to content

Commit

Permalink
deploy: 43ad72c
Browse files Browse the repository at this point in the history
  • Loading branch information
tyranron committed Dec 8, 2023
1 parent 6a354cb commit 1b0be3c
Show file tree
Hide file tree
Showing 47 changed files with 64 additions and 44 deletions.
10 changes: 4 additions & 6 deletions main/architecture/parser.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,12 @@ <h1 class="menu-title">Cucumber Rust Book</h1>
<h1 id="custom-parser"><a class="header" href="#custom-parser">Custom <code>Parser</code></a></h1>
<p>Let's start by implementing a custom <a href="https://docs.rs/cucumber/*/cucumber/trait.Parser.html"><code>Parser</code></a> which statically emits a single <a href="https://cucumber.io/docs/gherkin/reference#feature">feature</a> for execution.</p>
<p><a href="https://docs.rs/cucumber/*/cucumber/trait.Parser.html"><code>Parser</code></a> represents anything that emits a <a href="https://docs.rs/futures/*/futures/stream/trait.Stream.html"><code>Stream</code></a> of <a href="https://cucumber.io/docs/gherkin/reference#feature">feature</a>s.</p>
<pre><pre class="playground"><code class="language-rust edition2021"><span class="boring">extern crate async_trait;
</span><span class="boring">extern crate cucumber;
<pre><pre class="playground"><code class="language-rust edition2021"><span class="boring">extern crate cucumber;
</span><span class="boring">extern crate futures;
</span><span class="boring">extern crate tokio;
</span><span class="boring">
</span><span class="boring">use std::{path::PathBuf, time::Duration};
</span><span class="boring">
</span><span class="boring">use async_trait::async_trait;
</span><span class="boring">use cucumber::{cli, gherkin, given, parser, then, when, World};
</span><span class="boring">use futures::{future, stream};
</span><span class="boring">use tokio::time::sleep;
Expand Down Expand Up @@ -249,7 +247,7 @@ <h1 id="custom-parser"><a class="header" href="#custom-parser">Custom <code>Pars
description: None,
steps: vec![
gherkin::Step {
keyword: &quot;Given&quot;.into(),
keyword: &quot;Given &quot;.into(),
ty: gherkin::StepType::Given,
value: &quot;a hungry cat&quot;.into(),
docstring: None,
Expand All @@ -258,7 +256,7 @@ <h1 id="custom-parser"><a class="header" href="#custom-parser">Custom <code>Pars
position: gherkin::LineCol { line: 3, col: 5 },
},
gherkin::Step {
keyword: &quot;When&quot;.into(),
keyword: &quot;When &quot;.into(),
ty: gherkin::StepType::When,
value: &quot;I feed the cat&quot;.into(),
docstring: None,
Expand All @@ -267,7 +265,7 @@ <h1 id="custom-parser"><a class="header" href="#custom-parser">Custom <code>Pars
position: gherkin::LineCol { line: 4, col: 5 },
},
gherkin::Step {
keyword: &quot;Then&quot;.into(),
keyword: &quot;Then &quot;.into(),
ty: gherkin::StepType::Then,
value: &quot;the cat is not hungry&quot;.into(),
docstring: None,
Expand Down
10 changes: 4 additions & 6 deletions main/architecture/runner.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ <h1 class="menu-title">Cucumber Rust Book</h1>
<h1 id="custom-runner"><a class="header" href="#custom-runner">Custom <code>Runner</code></a></h1>
<p>Now, let's implement a custom <a href="https://docs.rs/cucumber/*/cucumber/trait.Runner.html"><code>Runner</code></a> which simply executes <a href="https://cucumber.io/docs/gherkin/reference#example">scenario</a>s in <a href="https://cucumber.io/docs/gherkin/reference#feature">feature</a>s sequentially, without considering <a href="https://cucumber.io/docs/cucumber/api#tags">tag</a>s, <a href="https://cucumber.io/docs/gherkin/reference#rule">rule</a>s, <a href="https://cucumber.io/docs/gherkin/reference#background"><code>Background</code></a>s or other extras, and specifically suitable for our <code>AnimalWorld</code> (for implementation simplicity).</p>
<p><a href="https://docs.rs/cucumber/*/cucumber/trait.Runner.html"><code>Runner</code></a> represents anything that transforms a <a href="https://docs.rs/futures/*/futures/stream/trait.Stream.html"><code>Stream</code></a> of <a href="https://cucumber.io/docs/gherkin/reference#feature">feature</a>s into a <a href="https://docs.rs/futures/*/futures/stream/trait.Stream.html"><code>Stream</code></a> of <a href="https://docs.rs/cucumber/*/cucumber/event/enum.Cucumber.html">cucumber events</a>.</p>
<pre><pre class="playground"><code class="language-rust edition2021"><span class="boring">extern crate async_trait;
</span><span class="boring">extern crate cucumber;
<pre><pre class="playground"><code class="language-rust edition2021"><span class="boring">extern crate cucumber;
</span><span class="boring">extern crate futures;
</span><span class="boring">extern crate once_cell;
</span><span class="boring">extern crate tokio;
Expand All @@ -189,7 +188,6 @@ <h1 id="custom-runner"><a class="header" href="#custom-runner">Custom <code>Runn
</span><span class="boring"> time::Duration,
</span><span class="boring">};
</span><span class="boring">
</span><span class="boring">use async_trait::async_trait;
</span><span class="boring">use cucumber::{
</span><span class="boring"> cli, event, gherkin, given, parser, step, then, when, Event, World,
</span><span class="boring">};
Expand Down Expand Up @@ -261,7 +259,7 @@ <h1 id="custom-runner"><a class="header" href="#custom-runner">Custom <code>Runn
</span><span class="boring"> description: None,
</span><span class="boring"> steps: vec![
</span><span class="boring"> gherkin::Step {
</span><span class="boring"> keyword: &quot;Given&quot;.into(),
</span><span class="boring"> keyword: &quot;Given &quot;.into(),
</span><span class="boring"> ty: gherkin::StepType::Given,
</span><span class="boring"> value: &quot;a hungry cat&quot;.into(),
</span><span class="boring"> docstring: None,
Expand All @@ -270,7 +268,7 @@ <h1 id="custom-runner"><a class="header" href="#custom-runner">Custom <code>Runn
</span><span class="boring"> position: gherkin::LineCol { line: 3, col: 5 },
</span><span class="boring"> },
</span><span class="boring"> gherkin::Step {
</span><span class="boring"> keyword: &quot;When&quot;.into(),
</span><span class="boring"> keyword: &quot;When &quot;.into(),
</span><span class="boring"> ty: gherkin::StepType::When,
</span><span class="boring"> value: &quot;I feed the cat&quot;.into(),
</span><span class="boring"> docstring: None,
Expand All @@ -279,7 +277,7 @@ <h1 id="custom-runner"><a class="header" href="#custom-runner">Custom <code>Runn
</span><span class="boring"> position: gherkin::LineCol { line: 4, col: 5 },
</span><span class="boring"> },
</span><span class="boring"> gherkin::Step {
</span><span class="boring"> keyword: &quot;Then&quot;.into(),
</span><span class="boring"> keyword: &quot;Then &quot;.into(),
</span><span class="boring"> ty: gherkin::StepType::Then,
</span><span class="boring"> value: &quot;the cat is not hungry&quot;.into(),
</span><span class="boring"> docstring: None,
Expand Down
Loading

0 comments on commit 1b0be3c

Please sign in to comment.