Skip to content

Commit 9307a7e

Browse files
committed
Migrate Linter test case for valid release data
1 parent a816019 commit 9307a7e

File tree

2 files changed

+43
-3
lines changed

2 files changed

+43
-3
lines changed

test/fixtures/ok/_data/releases.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
- version: 2.7.0
2-
date: 2018-01-01
3-
post: /en/news/2018/01/01/ok/
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# frozen_string_literal: true
2+
3+
require "helper"
4+
require "linter"
5+
6+
7+
describe Linter do
8+
9+
before do
10+
chdir_tempdir
11+
12+
@ok = "Checking markdown files... ok\n"
13+
end
14+
15+
after do
16+
teardown_tempdir
17+
end
18+
19+
it "checks ok valid release data with corresponding post" do
20+
releases_content = <<~YAML
21+
- version: 2.7.0
22+
date: 2018-01-01
23+
post: /en/news/2018/01/01/post/
24+
YAML
25+
26+
post_content = <<~POST
27+
---
28+
layout: news_post
29+
title: "Post"
30+
author: "stomar"
31+
translator:
32+
date: 2018-01-01 12:00:00 +0000
33+
lang: en
34+
---
35+
36+
Content
37+
POST
38+
39+
create_file("_data/releases.yml", releases_content)
40+
create_file("en/news/_posts/2018-01-01-post.md", post_content)
41+
_(linter_output).must_equal @ok
42+
end
43+
end

0 commit comments

Comments
 (0)