Skip to main content

Module bdd

Module bdd 

Source
Expand description

BDD-style testing helpers for Presentar.

Provides describe, it, and context management for expressive tests.

§Example

use presentar_test::bdd::*;

#[test]
fn button_widget_tests() {
    describe("Button", |ctx| {
        ctx.before(|| {
            // Setup code
        });

        ctx.it("renders with label", |_| {
            // Test code
            expect(true).to_be_true();
        });

        ctx.it("responds to click", |_| {
            expect(1 + 1).to_equal(2);
        });
    });
}

Structs§

Expectation
Wrapper for making assertions.
TestContext
Test context for BDD-style tests.

Functions§

describe
Describe a test suite.
describe_and_assert
Run a describe block and assert all tests pass.
expect
Create an expectation from a value.