mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-09-15 16:03:34 +08:00

This reverts commit 303192d9d575b26a77a00f7a62212f310ec1e329. This reverts commit cd9d128b47ed523036f7ae1232ec7adcf04ed8a9. GitJournal is used by non-English speakers (a lot in China and Russia) and while we don't support those languages completely, we do support them a little bit. I don't want to loose this functionality. It would be better for us to fix the bug in intl.
39 lines
896 B
Dart
39 lines
896 B
Dart
import 'dart:io';
|
|
|
|
import 'package:gitjournal/core/md_yaml_doc_loader.dart';
|
|
import 'package:path/path.dart' as p;
|
|
import 'package:test/test.dart';
|
|
|
|
void main() {
|
|
group('MdYamlDocLoader', () {
|
|
Directory tempDir;
|
|
String filePath;
|
|
var contents = """---
|
|
type: Journal
|
|
foo: bar
|
|
---
|
|
|
|
Alright.""";
|
|
|
|
setUpAll(() async {
|
|
tempDir = await Directory.systemTemp.createTemp('__doc_loader_test__');
|
|
filePath = p.join(tempDir.path, "doc0");
|
|
await File(filePath).writeAsString(contents);
|
|
});
|
|
|
|
tearDownAll(() async {
|
|
tempDir.deleteSync(recursive: true);
|
|
});
|
|
|
|
test('Should load one doc', () async {
|
|
var loader = MdYamlDocLoader();
|
|
var doc = await loader.loadDoc(filePath);
|
|
|
|
expect(doc.body, "Alright.");
|
|
expect(doc.props["type"], "Journal");
|
|
expect(doc.props["foo"], "bar");
|
|
expect(doc.props.length, 2);
|
|
});
|
|
});
|
|
}
|