Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Luca Fazzi <patrick91@live.it>
  • Loading branch information
pfazzi committed Jan 16, 2025
1 parent 873d034 commit 0f7c354
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use rust_arkitect::dsl::{ArchitecturalRules, Arkitect, Project};

#[test]
fn test_architectural_rules() {
let project = Project::from_relative_path(file!(), "./../");
let project = Project::new();

let rules = ArchitecturalRules::define()
.component("Domain")
Expand Down Expand Up @@ -70,7 +70,7 @@ You can define and test architectural rules:
```rust
#[test]
fn test_architecture_baseline() {
let project = Project::from_relative_path(file!(), "./../");
let project = Project::new();

let rules = ArchitecturalRules::define()
.component("Application")
Expand Down Expand Up @@ -169,9 +169,7 @@ impl Rule for TestRule {
#[test]
fn test_custom_rule_execution() {
// Define the project path
let project = Project::from_absolute_path(
"/Users/RandomUser/Projects/rust_arkitect/examples/sample_project",
);
let project = Project::new();

// Create a new instance of the custom rule
let rule = Box::new(TestRule::new("my_crate", &["a:crate::a_module"]));
Expand Down
16 changes: 5 additions & 11 deletions examples/workspace_project/tests/src/architecture_rules_test.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
use rust_arkitect::dsl::{ArchitecturalRules, Arkitect, Project};

fn project() -> Project {
Project::from_absolute_path(
"/Users/patrickfazzi/Projects/rust_arkitect/examples/workspace_project",
)
}

#[test]
fn test_vertical_slices_architecture_rules() {
Arkitect::init_logger();
Expand All @@ -30,18 +24,18 @@ fn test_vertical_slices_architecture_rules() {

.finalize();

let project = project();
let project = Project::new();

let result = Arkitect::ensure_that(project).complies_with(rules);

assert_eq!(result, Ok(()))
assert!(result.is_ok());
}

#[test]
fn test_mvc_architecture_rules() {
Arkitect::init_logger();

let project = project();
let project = Project::new();

#[rustfmt::skip]
let rules = ArchitecturalRules::define()
Expand All @@ -60,14 +54,14 @@ fn test_mvc_architecture_rules() {

let result = Arkitect::ensure_that(project).complies_with(rules);

assert_eq!(result, Ok(()))
assert!(result.is_ok());
}

#[test]
fn test_three_tier_architecture() {
Arkitect::init_logger();

let project = project();
let project =Project::new();

#[rustfmt::skip]
let rules = ArchitecturalRules::define()
Expand Down

0 comments on commit 0f7c354

Please sign in to comment.