Skip to content

Commit

Permalink
Added test for part 1 of #121
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Winger authored and Eric Winger committed Aug 29, 2018
1 parent eb12a60 commit ea48cdf
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
30 changes: 30 additions & 0 deletions sources/JadeiteProjectBrowserTestCase.cls
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,17 @@ selectServicesNamed: anArray in: presenter
add: service;
yourself)]!

selectTreeServicesNamed: anArray in: presenter
presenter resetSelection.
anArray do:
[:name |
| service |
service := presenter model asBag detect: [:svc | svc name = name]
ifNone: [self error: 'Tree element ' , name , ' not found'].
presenter selections: (presenter selections asOrderedCollection
add: service;
yourself)]!

serviceNamed: name in: presenter
| service |
service := presenter list detect: [:service | service name = name] ifNone: [].
Expand Down Expand Up @@ -169,6 +180,23 @@ test_classListNotBlank

!

test_extensionColoringInHierarchy
| testClass |
self selectServicesNamed: (Array with: 'Rowan') in: self projectListPresenter.
self selectServicesNamed: #('Rowan-Specifications') in: self packageListPresenter.
self selectServicesNamed: (Array with: 'RwPlatformSpecification') in: self classListPresenter.
testClass := self classListPresenter list
detect: [:classService | classService name = 'RwGemStoneSpecification']
ifNone: [].
self assertIsNil: testClass. "Our guy is an extension"
self selectHierarchyTab.
self
assert: self projectsPresenter classHierarchyPresenter selection name = 'RwPlatformSpecification'.
self deny: self projectsPresenter classHierarchyPresenter selection shouldColorAsExtension.
self selectTreeServicesNamed: (Array with: 'RwGemStoneSpecification')
in: self projectsPresenter classHierarchyPresenter.
self assert: self projectsPresenter classHierarchyPresenter selection shouldColorAsExtension!

test_hierarchySelectTwoBrowsers
| secondBrowser firstBrowser |
self testsIssue: #issue122 withTitle: 'Hierarchy tab selection updates incorrectly.'.
Expand Down Expand Up @@ -301,11 +329,13 @@ waitForPresenter: presenter
!JadeiteProjectBrowserTestCase categoriesFor: #selectHierarchyTabIn:!private!selection! !
!JadeiteProjectBrowserTestCase categoriesFor: #selectRowanSample1Class!private!selection! !
!JadeiteProjectBrowserTestCase categoriesFor: #selectServicesNamed:in:!private!selection! !
!JadeiteProjectBrowserTestCase categoriesFor: #selectTreeServicesNamed:in:!private!selection! !
!JadeiteProjectBrowserTestCase categoriesFor: #serviceNamed:in:!private!selection! !
!JadeiteProjectBrowserTestCase categoriesFor: #setUp!private!setup teardown! !
!JadeiteProjectBrowserTestCase categoriesFor: #tearDown!private!setup teardown! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_addRemoveCategory!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_classListNotBlank!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_extensionColoringInHierarchy!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_hierarchySelectTwoBrowsers!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_markDirty!public!test! !
!JadeiteProjectBrowserTestCase categoriesFor: #test_openProjectsBrowser!public!test! !
Expand Down
11 changes: 7 additions & 4 deletions sources/RowanClassService.cls
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,7 @@ displayString
^displayString!

displayStringFor: displayThing
definedPackageName = self notRowanizedPackageName
ifFalse:
[(self selectedPackageNames includes: definedPackageName)
ifFalse: [displayThing forecolor: Color darkMagenta]].
self shouldColorAsExtension ifTrue: [displayThing forecolor: Color darkMagenta].
^self displayString!

excludedInstVars
Expand Down Expand Up @@ -228,6 +225,11 @@ shouldClearMethods

^(#(#removeMethods) includes: command) not!

shouldColorAsExtension
^definedPackageName = self notRowanizedPackageName
ifTrue: [false]
ifFalse: [(self selectedPackageNames includes: definedPackageName) not]!

stonOn: stonWriter
| instanceVariableNames |
(instanceVariableNames := self class allInstVarNames reject: [:iv | self excludedInstVars includes: iv]) isEmpty
Expand Down Expand Up @@ -307,6 +309,7 @@ variables
!RowanClassService categoriesFor: #selectedPackageServices!accessing!private! !
!RowanClassService categoriesFor: #selectedPackageServices:!accessing!private! !
!RowanClassService categoriesFor: #shouldClearMethods!public!replication!testing! !
!RowanClassService categoriesFor: #shouldColorAsExtension!public!testing! !
!RowanClassService categoriesFor: #stonOn:!must not strip!public!ston! !
!RowanClassService categoriesFor: #template!accessing!private! !
!RowanClassService categoriesFor: #template:!accessing!private! !
Expand Down

0 comments on commit ea48cdf

Please sign in to comment.