Skip to content

Commit

Permalink
fix(test): update tests about optional config values
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Jan 16, 2022
1 parent e02ae0b commit 8bb48b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions git-cliff-core/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::fmt::Write;
fn generate_changelog() -> Result<()> {
let changelog_config = ChangelogConfig {
header: Some(String::from("this is a changelog")),
body: String::from(
body: Some(String::from(
r#"
## Release {{ version }}
{% for group, commits in commits | group_by(attribute="group") %}
Expand All @@ -32,12 +32,12 @@ fn generate_changelog() -> Result<()> {
{% endif -%}
{% endfor -%}
{% endfor %}"#,
),
)),
footer: Some(String::from("eoc - end of changelog")),
trim: None,
};
let git_config = GitConfig {
conventional_commits: true,
conventional_commits: Some(true),
filter_unconventional: Some(true),
commit_parsers: Some(vec![
CommitParser {
Expand Down Expand Up @@ -140,7 +140,7 @@ fn generate_changelog() -> Result<()> {
];

let out = &mut String::new();
let template = Template::new(changelog_config.body)?;
let template = Template::new(changelog_config.body.unwrap())?;

writeln!(out, "{}", changelog_config.header.unwrap()).unwrap();
for release in releases {
Expand Down
6 changes: 3 additions & 3 deletions git-cliff/src/changelog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ mod test {
let config = Config {
changelog: ChangelogConfig {
header: Some(String::from("# Changelog")),
body: String::from(
body: Some(String::from(
r#"{% if version %}
## Release [{{ version }}] - {{ timestamp | date(format="%Y-%m-%d") }}
({{ commit_id }}){% else %}
Expand All @@ -181,12 +181,12 @@ mod test {
#### {{ group }}{% for commit in commits %}
- {{ commit.message }}{% endfor %}
{% endfor %}{% endfor %}"#,
),
)),
footer: Some(String::from("------------")),
trim: Some(true),
},
git: GitConfig {
conventional_commits: true,
conventional_commits: Some(true),
filter_unconventional: Some(false),
commit_parsers: Some(vec![
CommitParser {
Expand Down

0 comments on commit 8bb48b0

Please sign in to comment.