forked from pillar-markup/Microdown
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request pillar-markup#737 from moufort/dev
Correction and update of Microdown-Blog
- Loading branch information
Showing
6 changed files
with
332 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
Class { | ||
#name : 'MicSummarizerTest', | ||
#superclass : 'TestCase', | ||
#category : 'Microdown-Blog-Tests', | ||
#package : 'Microdown-Blog-Tests' | ||
} | ||
|
||
{ #category : 'tests' } | ||
MicSummarizerTest >> createListOfFile [ | ||
|
||
| q | | ||
q := Array new: 3. | ||
q at: 1 put: self generateFilesystemExample1; | ||
at: 2 put: self generateFilesystemExample2; | ||
at: 3 put: self generateFilesystemExample3. | ||
^ q | ||
] | ||
|
||
{ #category : 'tests' } | ||
MicSummarizerTest >> createListOfMicRootBlock [ | ||
|
||
| q singleSummarizer | | ||
q := Array new: 3. | ||
singleSummarizer := MicSingleSummarizer new. | ||
q | ||
at: 1 put: (singleSummarizer summarize: (Microdown parse: | ||
self generateFilesystemExample1 asFileReference contents)); | ||
at: 2 put: (singleSummarizer summarize: (Microdown parse: | ||
self generateFilesystemExample2 asFileReference contents)); | ||
at: 3 put: (singleSummarizer summarize: (Microdown parse: | ||
self generateFilesystemExample3 asFileReference contents)). | ||
^ q | ||
] | ||
|
||
{ #category : 'tests' } | ||
MicSummarizerTest >> generateFilesystemExample1 [ | ||
|
||
| file | | ||
file := FileSystem memory workingDirectory / 'anExample1.md'. | ||
file writeStreamDo: [ :stream | | ||
stream nextPutAll: '{ | ||
"date" : "8 January 2019" | ||
} | ||
# A Cool Story | ||
Pharo is cool but _this is_ a superlong _paragraph_ Simple powerful language: No constructors, no types declaration, no interfaces, no primitive types. Yet a powerful and elegant language with a full syntax fitting in one postcard! Pharo is objects and messages all the way down. _Live_, immersive environment: Immediate feedback at any moment of your development: _Developing_, testing, debugging. Even in production environments, you will never be stuck in compiling and deploying steps again! | ||
Amazing debugging experience: The Pharo environment includes a debugger unlike anything you''ve seen before. It allows you to step through code, restart the execution of methods, create methods on the fly, and much more! | ||
' ]. | ||
|
||
^ file | ||
] | ||
|
||
{ #category : 'tests' } | ||
MicSummarizerTest >> generateFilesystemExample2 [ | ||
|
||
| file | | ||
file := FileSystem memory workingDirectory / 'anExample2.md'. | ||
file writeStreamDo: [ :stream | | ||
stream nextPutAll: '{ | ||
"date" : "22 January 2019" | ||
} | ||
# Pharo is cool | ||
If you are either a beginner or an expert in object-oriented programming, _this MOOC_ will change the way you program with objects: come and learn or rediscover _object-oriented programming_ with Pharo! | ||
Pharo is a pure _object-oriented programming language_ in the tradition of Smalltalk. It offers a unique developing experience in constant interaction with live objects. Pharo is elegant, fun to use and very powerful. It is very easy to learn and enables to understand advanced concept in a natural way. When programming in Pharo, you are immersed in a world of live objects. You have immediate feedback at any moment of your development on objects representing web applications, code itself, graphics, network. More… | ||
' ]. | ||
|
||
^ file | ||
] | ||
|
||
{ #category : 'tests' } | ||
MicSummarizerTest >> generateFilesystemExample3 [ | ||
|
||
| file | | ||
file := FileSystem memory workingDirectory / 'anExample3.md'. | ||
file writeStreamDo: [ :stream | | ||
stream nextPutAll: '{ | ||
"date" : "29 January 2018" | ||
} | ||
# Mooc Pharo | ||
Welcome to the Pharo Mooc (a set of videos, exercises, challenges, and miniprojects). | ||
The Pharo Mooc is fully dubbed in french and english. It comes with subtitles in Japanese, english, french and spanish. This web site contains all the material of this Mooc in free access. | ||
In addition, in average every 18 months the Mooc is proposed and run on the France Université Numérique platform (Even if the platform is french the mooc is run in both languages). | ||
When you participate to the mooc you get access to the quizz and the credit validation. | ||
' ]. | ||
|
||
^ file | ||
] | ||
|
||
{ #category : 'tests' } | ||
MicSummarizerTest >> testGroupByDate [ | ||
|
||
| summary group | | ||
summary := self createListOfMicRootBlock. | ||
group := MicSummarizer new group: summary byDate: (Date newDay: 1 month: 'January' year: 2019). | ||
|
||
self assert: group size equals: 2. | ||
] | ||
|
||
{ #category : 'tests' } | ||
MicSummarizerTest >> testSummarize [ | ||
|
||
| summary | | ||
summary := MicSummarizer new summarize: self createListOfMicRootBlock. | ||
self | ||
assert: (summary isKindOf: MicRootBlock); | ||
assert: summary children size equals: 6 | ||
] | ||
|
||
{ #category : 'tests' } | ||
MicSummarizerTest >> testSummarizeFile [ | ||
|
||
| summary | | ||
summary := MicSummarizer new summarizeFile: self createListOfFile. | ||
self | ||
assert: (summary isKindOf: MicRootBlock); | ||
assert: summary children size equals: 6 | ||
] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.