Skip to content

Commit

Permalink
fix: Fix fixtures stored in wrong and alter yaml complex tests
Browse files Browse the repository at this point in the history
Signed-off-by: Xuanwo <[email protected]>
  • Loading branch information
Xuanwo authored and yuchanns committed Jul 21, 2024
1 parent a041ff3 commit 2fbab54
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 39 deletions.
74 changes: 37 additions & 37 deletions src/tests/fixtures/complex.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ components: <%= site.styles %>/components

helpers: <%= site.templates %>/helpers
plugins:
# - assemble-contrib-permalinks
# - assemble-contrib-anchors
# - assemble-contrib-toc
# - assemble-contrib-permalinks
# - assemble-contrib-anchors
# - assemble-contrib-toc


# =============================================
Expand All @@ -53,34 +53,34 @@ description: <%= pkg.description %>
# URLs
url:

# Repo
homepage: <%= pkg.homepage %>
repo: <%= pkg.homepage %>
issues: <%= pkg.bugs.url %>?state=open
ghpages: https://<%= site.username %>.github.io/<%= pkg.name %>/
# Repo
homepage: <%= pkg.homepage %>
repo: <%= pkg.homepage %>
issues: <%= pkg.bugs.url %>?state=open
ghpages: https://<%= site.username %>.github.io/<%= pkg.name %>/

# Site
domain: http://assemble.io/
about: <%= site.url.domain %>/about/
blog: <%= site.url.domain %>/blog/
# Site
domain: http://assemble.io/
about: <%= site.url.domain %>/about/
blog: <%= site.url.domain %>/blog/

# Download Links
download:
source: <%= pkg.homepage %>/archive/master.zip
latest: <%= pkg.homepage %>/master/dist/<%= pkg.name %>-<%= pkg.version %>.min.js
source: <%= pkg.homepage %>/archive/master.zip
latest: <%= pkg.homepage %>/master/dist/<%= pkg.name %>-<%= pkg.version %>.min.js


# =============================================
# SEO / SEM
# =============================================

analytics:
alexa: lpTeh1awA400OE
google:
id: UA-XXXXXXXX-YY
domain: assemble.github.io
siteid: false
tags: FOO-012345 # Google Tags (see: https://www.google.com/tagmanager/)
alexa: lpTeh1awA400OE
google:
id: UA-XXXXXXXX-YY
domain: assemble.github.io
siteid: false
tags: FOO-012345 # Google Tags (see: https://www.google.com/tagmanager/)


# =============================================
Expand All @@ -89,28 +89,28 @@ tags: FOO-012345 # Google Tags (see: https://www.google.com/tagmanager

# Comments
disqus:
enabled: false
shortname: <%= pkg.name %>
enabled: false
shortname: <%= pkg.name %>

# Social
social:
twitter:
via: jonschlinkert
username: jonschlinkert
related: jonschlinkert:Assemble core team.
facebook: false
linkedin: false
gplus: false
hn: false
google: false
twitter:
via: jonschlinkert
username: jonschlinkert
related: jonschlinkert:Assemble core team.
facebook: false
linkedin: false
gplus: false
hn: false
google: false

# Sharing
sharing:
twitter: false
facebook: false
gplus: false
hn: false
google: false
twitter: false
facebook: false
gplus: false
hn: false
google: false
---

<span class="alert alert-info">This is an alert</span>
Expand Down Expand Up @@ -288,4 +288,4 @@ _This file was generated by [grunt-readme](https://github.com/assemble/grunt-rea

[grunt]: http://gruntjs.com/
[Getting Started]: https://github.com/gruntjs/grunt/blob/devel/docs/getting_started.md
[package.json]: https://npmjs.org/doc/json.html
[package.json]: https://npmjs.org/doc/json.html
10 changes: 8 additions & 2 deletions src/tests/matter_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,19 @@ fn test_parse_complex_yaml_front_matter() {
struct FrontMatter {
root: String,
assets: String,
google: bool,
analytics: Analytics,
}
#[derive(serde::Deserialize, PartialEq, Debug)]
struct Analytics {
alexa: String,
}
let result: ParsedEntityStruct<FrontMatter> = matter_yaml_struct("complex.md").unwrap();
let data_expected = FrontMatter {
root: "_gh_pages".to_string(),
assets: "<%= site.dest %>/assets".to_string(),
google: false,
analytics: Analytics {
alexa: "lpTeh1awA400OE".to_string(),
},
};
assert_eq!(
result.data, data_expected,
Expand Down

0 comments on commit 2fbab54

Please sign in to comment.