Patrick Rein uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-pre.411.mcz==================== Summary ====================
Name: Tests-pre.411
Author: pre
Time: 3 May 2019, 4:34:55.658882 pm
UUID: 8679cdcb-147d-4246-9cbd-01f00224c140
Ancestors: Tests-pre.410
Adds a simple test case for listing file directory entries and adjusts the tearDown accordingly.
=============== Diff against Tests-pre.410 ===============
Item was changed:
+ ----- Method: FileDirectoryTest>>deleteDirectory (in category 'running') -----
- ----- Method: FileDirectoryTest>>deleteDirectory (in category 'tests - create/delete') -----
deleteDirectory
+ (self myDirectory exists) ifTrue: [self myDirectory recursiveDelete]!
- (self myDirectory exists) ifTrue:
- [self myDirectory containingDirectory deleteDirectory: self myLocalDirectoryName]!
Item was changed:
+ ----- Method: FileDirectoryTest>>tearDown (in category 'running') -----
- ----- Method: FileDirectoryTest>>tearDown (in category 'resources') -----
tearDown
[ self deleteDirectory ] on: Error do: [ :ex | ]!
Item was changed:
----- Method: FileDirectoryTest>>testDeleteDirectory (in category 'tests - create/delete') -----
testDeleteDirectory
"Test deletion of a directory"
| aContainingDirectory preTestItems |
aContainingDirectory := self myDirectory containingDirectory.
preTestItems := aContainingDirectory fileAndDirectoryNames.
+ self myAssuredDirectory.
- self assert: self myAssuredDirectory exists.
aContainingDirectory deleteDirectory: self myLocalDirectoryName.
+ self
+ shouldnt: [aContainingDirectory directoryNames includes: self myLocalDirectoryName ]
- self shouldnt:
- [aContainingDirectory directoryNames
- includes: self myLocalDirectoryName ]
description: 'Should successfully delete directory.'.
+ self
+ should: [preTestItems = aContainingDirectory fileAndDirectoryNames]
- self should:
- [preTestItems = aContainingDirectory fileAndDirectoryNames]
description: 'Should only delete the indicated directory.'.
!
Item was added:
+ ----- Method: FileDirectoryTest>>testListEntries (in category 'tests') -----
+ testListEntries
+
+ self myAssuredDirectory createDirectory: 'foobar'.
+ self myAssuredDirectory createDirectory: 'b'.
+ self myAssuredDirectory fileNamed: 'test.file' do: [:str |
+ str << 'test content'].
+ self
+ assert: 3 equals: self myAssuredDirectory entries size
+ description: '#entries should list all contained directory entries'!