Skip to content

Commit

Permalink
refactor: simplifying tests assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
DeveloperC286 committed Nov 29, 2020
1 parent 39e9b06 commit 7ba0e86
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/increment/tests/generated_tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fn test_generate_major_commits() {
for commit_message in commits {
//When/Then
println!("{}", commit_message);
assert_eq!(true, is_major_increment(&*commit_message));
assert!(is_major_increment(&*commit_message));
}
}
}
Expand All @@ -45,7 +45,7 @@ fn test_generate_major_body_commits() {
for commit_message in commits {
//When/Then
println!("{}", commit_message);
assert_eq!(true, is_major_increment(&*commit_message));
assert!(is_major_increment(&*commit_message));
}
}
}
Expand All @@ -70,7 +70,7 @@ fn test_generate_minor_commits() {
for commit_message in commits {
//When/Then
println!("{}", commit_message);
assert_eq!(true, is_minor_increment(&*commit_message));
assert!(is_minor_increment(&*commit_message));
}
}
}
Expand All @@ -95,7 +95,7 @@ fn test_generate_patch_commits() {
for commit_message in commits {
//When/Then
println!("{}", commit_message);
assert_eq!(true, is_patch_increment(&*commit_message));
assert!(is_patch_increment(&*commit_message));
}
}
}
10 changes: 5 additions & 5 deletions src/increment/tests/minor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ use crate::increment::*;
case("feat(completion): takes negated flags into account when")
)]
fn test_is_minor_increment(commit_message: &str) {
assert_eq!(true, is_minor_increment(commit_message));
assert!(is_minor_increment(commit_message));
}

#[rstest(
commit_message,
case("FEAT: add usage for single-digit boolean aliases (#1580)\n\n")
)]
fn test_is_minor_increment_case_sensitivity(commit_message: &str) {
assert_eq!(true, is_minor_increment(commit_message));
assert!(is_minor_increment(commit_message));
}

#[rstest(
Expand All @@ -26,7 +26,7 @@ fn test_is_minor_increment_case_sensitivity(commit_message: &str) {
case("feat(yargs_parser): introduce single-digit boolean aliases (#1576)\n\n")
)]
fn test_is_minor_increment_invalid_scope(commit_message: &str) {
assert_eq!(true, is_minor_increment(commit_message));
assert!(is_minor_increment(commit_message));
}

#[rstest(
Expand All @@ -45,7 +45,7 @@ fn test_is_not_minor_increment(commit_message: &str) {
case(" feat(completion): takes negated flags into account when")
)]
fn test_is_minor_increment_preceding_whitespace(commit_message: &str) {
assert_eq!(true, is_minor_increment(commit_message));
assert!(is_minor_increment(commit_message));
}

#[rstest(
Expand All @@ -64,7 +64,7 @@ fn test_is_not_minor_increment_preceding_whitespace(commit_message: &str) {
case("feat(): takes negated flags into account when")
)]
fn test_is_minor_increment_empty_scope(commit_message: &str) {
assert_eq!(true, is_minor_increment(commit_message));
assert!(is_minor_increment(commit_message));
}

#[rstest(
Expand Down
10 changes: 5 additions & 5 deletions src/increment/tests/patch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ use crate::increment::*;
case("fix(deps): fix enumeration for normalized path arguments (#1567)\n\n")
)]
fn test_is_patch_increment(commit_message: &str) {
assert_eq!(true, is_patch_increment(commit_message));
assert!(is_patch_increment(commit_message));
}

#[rstest(
commit_message,
case("FIX: __proto__ will now be replaced with ___proto___ in parse (#1591)")
)]
fn test_is_patch_increment_case_sensitivity(commit_message: &str) {
assert_eq!(true, is_patch_increment(commit_message));
assert!(is_patch_increment(commit_message));
}

#[rstest(
Expand All @@ -26,7 +26,7 @@ fn test_is_patch_increment_case_sensitivity(commit_message: &str) {
case("fix(deps_updated): fix enumeration for normalized path arguments (#1567)\n\n")
)]
fn test_is_patch_increment_invalid_scope(commit_message: &str) {
assert_eq!(true, is_patch_increment(commit_message));
assert!(is_patch_increment(commit_message));
}

#[rstest(
Expand All @@ -45,7 +45,7 @@ fn test_is_not_patch_increment(commit_message: &str) {
case("\tfix(deps): fix enumeration for normalized path arguments (#1567)\n\n")
)]
fn test_is_patch_increment_preceding_whitespace(commit_message: &str) {
assert_eq!(true, is_patch_increment(commit_message));
assert!(is_patch_increment(commit_message));
}

#[rstest(
Expand All @@ -64,7 +64,7 @@ fn test_is_not_patch_increment_preceding_whitespace(commit_message: &str) {
case("fix(): fix enumeration for normalized path arguments (#1567)\n\n")
)]
fn test_is_patch_increment_empty_scope(commit_message: &str) {
assert_eq!(true, is_patch_increment(commit_message));
assert!(is_patch_increment(commit_message));
}

#[rstest(
Expand Down

0 comments on commit 7ba0e86

Please sign in to comment.