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