Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use file list from newtools #655

Merged
merged 20 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/BaselineOfNewTools/BaselineOfNewTools.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,9 @@ BaselineOfNewTools >> baseline: spec [
'FontChooser'
'Methods'
'Spotter'
'RewriterTools'
'ScopesEditor') ]
'RewriterTools'
'ScopesEditor'
'FileBrowser') ]
]

{ #category : 'external projects' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
A FDAbstractFilterTest is a test class for testing the behavior of FDAbstractFilter
"
Class {
#name : 'StFBAbstractFilterTest',
#superclass : 'StFBTestCase',
#name : 'StAbstractFilterTest',
#superclass : 'StFileBrowserTestCase',
#instVars : [
'filter'
],
Expand All @@ -13,67 +13,67 @@ Class {
}

{ #category : 'testing' }
StFBAbstractFilterTest class >> isAbstract [
^ self = StFBAbstractFilterTest
StAbstractFilterTest class >> isAbstract [
^ self = StAbstractFilterTest
]

{ #category : 'accessing' }
StFBAbstractFilterTest >> actualClass [
StAbstractFilterTest >> actualClass [
^ self subclassResponsibility
]

{ #category : 'accessing' }
StFBAbstractFilterTest >> bananaJpg [
StAbstractFilterTest >> bananaJpg [
^ root / 'banana.jpg'
]

{ #category : 'accessing' }
StFBAbstractFilterTest >> dir [
StAbstractFilterTest >> dir [
^ root / 'dir'
]

{ #category : 'accessing' }
StFBAbstractFilterTest >> dirExt [
StAbstractFilterTest >> dirExt [
^ root / 'dir.ext'
]

{ #category : 'instance creation' }
StFBAbstractFilterTest >> fileNamed: aString [
StAbstractFilterTest >> fileNamed: aString [
^ FileSystem memory / aString
]

{ #category : 'accessing' }
StFBAbstractFilterTest >> hidden [
StAbstractFilterTest >> hidden [
^ root / '.hidden'
]

{ #category : 'accessing' }
StFBAbstractFilterTest >> hiddenDir [
StAbstractFilterTest >> hiddenDir [
^ root / '.hidden-dir'
]

{ #category : 'accessing' }
StFBAbstractFilterTest >> patatePng [
StAbstractFilterTest >> patatePng [
^ root / 'patate.png'
]

{ #category : 'running' }
StFBAbstractFilterTest >> setUp [
StAbstractFilterTest >> setUp [
super setUp.
filter := self actualClass new
]

{ #category : 'accessing' }
StFBAbstractFilterTest >> sthAaa [
StAbstractFilterTest >> sthAaa [
^ root / 'sth.aaa'
]

{ #category : 'accessing' }
StFBAbstractFilterTest >> sthExt [
StAbstractFilterTest >> sthExt [
^ root / 'sth.ext'
]

{ #category : 'tests' }
StFBAbstractFilterTest >> testPredicate [
StAbstractFilterTest >> testPredicate [
self subclassResponsibility
]
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
A FDBitmapFilterTest is a test class for testing the behavior of FDBitmapFilter
"
Class {
#name : 'StFBBitmapFilterTest',
#superclass : 'StFBExtensionsFilterTest',
#name : 'StBitmapFilterTest',
#superclass : 'StExtensionsFilterTest',
#category : 'NewTools-FileBrowser-Tests-Filtering',
#package : 'NewTools-FileBrowser-Tests',
#tag : 'Filtering'
}

{ #category : 'accessing' }
StFBBitmapFilterTest >> actualClass [
^ StFBBitmapFilter
StBitmapFilterTest >> actualClass [
^ StBitmapFilter
]

{ #category : 'tests' }
StFBBitmapFilterTest >> testPredicate [
StBitmapFilterTest >> testPredicate [
self assert: (filter predicate: (self fileNamed: 'bitmap.bmp')).
self assert: (filter predicate: (self fileNamed: 'bitmap.dib')).
self deny: (filter predicate: (self fileNamed: 'bitmap.png'))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Class {
#name : 'StFBWindowPathPresenterTest',
#superclass : 'StFBTestCase',
#name : 'StBreadcrumbPresenterTest',
#superclass : 'StFileBrowserTestCase',
#instVars : [
'windowPathUI'
],
Expand All @@ -10,19 +10,21 @@ Class {
}

{ #category : 'running' }
StFBWindowPathPresenterTest >> setUp [
StBreadcrumbPresenterTest >> setUp [
super setUp.
windowPathUI := StFBWindowPathPresenter new
windowPathUI := StPathBreadcrumbPresenter
owner: fileSystemPresenter
on: fileSystemModel
]

{ #category : 'running' }
StFBWindowPathPresenterTest >> tearDown [
StBreadcrumbPresenterTest >> tearDown [
windowPathUI withWindowDo: [ :window | window close ].
super tearDown
]

{ #category : 'tests' }
StFBWindowPathPresenterTest >> testRoot [
StBreadcrumbPresenterTest >> testRoot [

windowPathUI currentDirectory: FileLocator root.
windowPathUI open.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
A FDDirectoryFilterTest is a test class for testing the behavior of FDDirectoryFilter
"
Class {
#name : 'StFBDirectoryFilterTest',
#superclass : 'StFBAbstractFilterTest',
#name : 'StDirectoryFilterTest',
#superclass : 'StAbstractFilterTest',
#category : 'NewTools-FileBrowser-Tests-Filtering',
#package : 'NewTools-FileBrowser-Tests',
#tag : 'Filtering'
}

{ #category : 'accessing' }
StFBDirectoryFilterTest >> actualClass [
^ StFBDirectoryFilter
StDirectoryFilterTest >> actualClass [

^ StDirectoryFilter
]

{ #category : 'tests' }
StFBDirectoryFilterTest >> testPredicate [
StDirectoryFilterTest >> testPredicate [
self assertCollection: (filter applyOn: root children) hasSameElements: {self dir . self dirExt . self hiddenDir}
]
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
A FDExtensionsFilterTest is a test class for testing the behavior of FDExtensionsFilter
"
Class {
#name : 'StFBExtensionsFilterTest',
#superclass : 'StFBAbstractFilterTest',
#name : 'StExtensionsFilterTest',
#superclass : 'StAbstractFilterTest',
#category : 'NewTools-FileBrowser-Tests-Filtering',
#package : 'NewTools-FileBrowser-Tests',
#tag : 'Filtering'
}

{ #category : 'testing' }
StFBExtensionsFilterTest class >> isAbstract [
^ self = StFBExtensionsFilterTest
StExtensionsFilterTest class >> isAbstract [
^ self = StExtensionsFilterTest
]
37 changes: 0 additions & 37 deletions src/NewTools-FileBrowser-Tests/StFBTestCase.class.st

This file was deleted.

42 changes: 42 additions & 0 deletions src/NewTools-FileBrowser-Tests/StFileBrowserTestCase.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Class {
#name : 'StFileBrowserTestCase',
#superclass : 'TestCase',
#instVars : [
'root',
'fileSystemModel',
'fileSystemPresenter'
],
#category : 'NewTools-FileBrowser-Tests-UI',
#package : 'NewTools-FileBrowser-Tests',
#tag : 'UI'
}

{ #category : 'testing' }
StFileBrowserTestCase class >> isAbstract [
^ self = StFileBrowserTestCase
]

{ #category : 'accessing' }
StFileBrowserTestCase class >> resources [
^ {StFileSystemResource}
]

{ #category : 'testing' }
StFileBrowserTestCase class >> shouldInheritSelectors [
^ true
]

{ #category : 'instance creation' }
StFileBrowserTestCase >> inspectRoot [
<script: 'self basicNew createRoot asFileReference inspect'>

]

{ #category : 'running' }
StFileBrowserTestCase >> setUp [

super setUp.
fileSystemModel := StFileSystemModel new.
fileSystemPresenter := StFileSystemPresenter on: fileSystemModel.
root := StFileSystemResource current root
]
Loading
Loading