puerto 0.14.0

Puerto — Rust full-stack DDD framework CLI. Scaffolds Clean Architecture projects with auto-wired DI, SQLx support, and zero manual wiring. Formerly puerto-framework.
1
2
3
4
5
6
7
8
9
10
11
12
{# One error-mapper test: the error maps to `status` and carries `code` in `name`. #}
{% macro error_case(name, error, status, code) %}
    #[test]
    fn {{ name }}() {
        // Act
        let (status, Json(body)) = {{ error }}.into_error_response();

        // Assert
        assert_eq!(status, StatusCode::{{ status }});
        assert_eq!(body.name, "{{ code }}");
    }
{% endmacro error_case %}