Improving test coverage examples.
This commit is contained in:
parent
401168ac91
commit
07cd424cee
@ -14,7 +14,7 @@ Class {
|
|||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
TWSeed class >> default [
|
TWSeed class >> default [
|
||||||
|
|
||||||
^ (self list select: [ :seed | seed name = 'ProjectifyMod' ]) first
|
^ self selectSeed: 'ProjectifyMod'
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
@ -37,7 +37,7 @@ TWSeed class >> initialize [
|
|||||||
demo: 'https://mutabit.com/repos.fossil/tiddlywiki/uv/seeds/projectify/projectify-mod.html');
|
demo: 'https://mutabit.com/repos.fossil/tiddlywiki/uv/seeds/projectify/projectify-mod.html');
|
||||||
add: (self new
|
add: (self new
|
||||||
name: 'Wikilexias';
|
name: 'Wikilexias';
|
||||||
demo: '');
|
demo: 'https://mutabit.com/repos.fossil/tiddlywiki/uv/seeds/wikilexias/wikilexias.html');
|
||||||
add: (self new
|
add: (self new
|
||||||
name: 'NotebookMod';
|
name: 'NotebookMod';
|
||||||
demo: '');
|
demo: '');
|
||||||
@ -52,10 +52,10 @@ TWSeed class >> initialize [
|
|||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
TWSeed class >> installDefaultInto: folder as: shortName [
|
TWSeed class >> install: seedName into: folder as: shortName [
|
||||||
|
|
||||||
| url subfolder file |
|
| file url seedFile subfolder wiki |
|
||||||
url := self default demo.
|
seedFile := self selectSeed: seedName.
|
||||||
subfolder := (folder / shortName) ensureCreateDirectory.
|
subfolder := (folder / shortName) ensureCreateDirectory.
|
||||||
file := subfolder / 'index.html'.
|
file := subfolder / 'index.html'.
|
||||||
file exists
|
file exists
|
||||||
@ -65,7 +65,17 @@ TWSeed class >> installDefaultInto: folder as: shortName [
|
|||||||
self deleteWikiFileFromFolder: folder andSubfolder: shortName.'.
|
self deleteWikiFileFromFolder: folder andSubfolder: shortName.'.
|
||||||
^ self
|
^ self
|
||||||
].
|
].
|
||||||
^ url asUrl saveContentsToFile: file.
|
url := seedFile demo.
|
||||||
|
url asUrl saveContentsToFile: file.
|
||||||
|
^ wiki := TiddlyWiki new
|
||||||
|
file: file;
|
||||||
|
name: shortName.
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
TWSeed class >> installDefaultInto: folder as: shortName [
|
||||||
|
|
||||||
|
^ self install: 'ProjectifyMod' into: folder as: shortName
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
@ -78,6 +88,12 @@ TWSeed class >> list [
|
|||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
TWSeed class >> selectSeed: aSeedName [
|
||||||
|
|
||||||
|
^ (self list select: [ :seed | seed name = aSeedName ]) first
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
TWSeed >> demo [
|
TWSeed >> demo [
|
||||||
|
|
||||||
|
@ -4,6 +4,22 @@ Class {
|
|||||||
#category : #'TiddlyWiki-TiddlyWiki'
|
#category : #'TiddlyWiki-TiddlyWiki'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
TWSeedTest >> testCreateAlternativeSeed [
|
||||||
|
|
||||||
|
| seed |
|
||||||
|
seed := TWSeed install: 'Wikilexias' into: FileLocator temp as: 'Wikilexias'.
|
||||||
|
self assert: seed file equals: (FileLocator temp / 'Wikilexias' / 'index.html')
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
TWSeedTest >> testDefaultIsSeed [
|
||||||
|
|
||||||
|
| seed |
|
||||||
|
seed := TWSeed default.
|
||||||
|
self assert: seed class equals: TWSeed
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
TWSeedTest >> testListIsNotEmpty [
|
TWSeedTest >> testListIsNotEmpty [
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user