pub enum Category {
E2e,
Integration,
Unit,
Doctest,
Scenario,
}Expand description
What kind of test a route reaches, read off the test’s identity and never declared.
use majordomus_cli::evidence::subject::Category;
assert_eq!(Category::of("suite:07_scope"), Some(Category::E2e));
assert_eq!(Category::of("crate:why"), Some(Category::Integration));
assert_eq!(Category::of("lib/x.sh"), None);Variants§
E2e
A behavioural case of the suite, driving the tools end to end.
Integration
An integration test binary of the crate.
Unit
A unit test inside the library (no runner records one yet).
Doctest
A documentation example (no runner records one yet).
Scenario
A use case’s scenario.
Implementations§
Source§impl Category
impl Category
Sourcepub fn of(test: &str) -> Option<Category>
pub fn of(test: &str) -> Option<Category>
The category of a test identity, or None when no runner’s prefix is on it. The
first matching prefix wins, so a library unit test is never read as an integration
binary.
use majordomus_cli::evidence::subject::Category;
assert_eq!(Category::of("crate:lib::evidence::x"), Some(Category::Unit));
assert_eq!(Category::of("crate:cli_examples"), Some(Category::Integration));
assert_eq!(Category::of("doc:x"), Some(Category::Doctest));Trait Implementations§
impl Copy for Category
Source§impl<'de> Deserialize<'de> for Category
impl<'de> Deserialize<'de> for Category
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Category
Source§impl JsonSchema for Category
impl JsonSchema for Category
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Ord for Category
impl Ord for Category
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Category
impl PartialOrd for Category
impl StructuralPartialEq for Category
Auto Trait Implementations§
impl Freeze for Category
impl RefUnwindSafe for Category
impl Send for Category
impl Sync for Category
impl Unpin for Category
impl UnsafeUnpin for Category
impl UnwindSafe for Category
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.