Skip to content

Commit 5ce01b8

Browse files
committed
test: add a test with a struct
1 parent a8f22ff commit 5ce01b8

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ray-rust"
3-
version = "0.1.4"
3+
version = "0.1.5"
44
edition = "2021"
55
authors = ["ALameLlama [email protected]"]
66
description = "Spatie Ray in Rust"

src/tests.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,23 @@ fn test_rd_macro_with_multiple_args() {
6464
assert_eq!(ray.request.payloads.len(), 1);
6565
}
6666

67+
#[test]
68+
fn test_ray_macro_with_struct() {
69+
#[derive(Debug, Serialize, Deserialize, Clone)]
70+
struct TestStruct {
71+
name: String,
72+
age: i32,
73+
}
74+
75+
let test_struct = TestStruct {
76+
name: "John".to_string(),
77+
age: 30,
78+
};
79+
80+
let ray = ray!(test_struct);
81+
assert_eq!(ray.request.payloads.len(), 1);
82+
}
83+
6784
#[test]
6885
fn test_ray_log_function() {
6986
let mut ray = Ray::new();

0 commit comments

Comments
 (0)