The Trunk: KernelTests-dtl.137.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: KernelTests-dtl.137.mcz

commits-2
David T. Lewis uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-dtl.137.mcz

==================== Summary ====================

Name: KernelTests-dtl.137
Author: dtl
Time: 14 February 2010, 10:15:26.342 pm
UUID: 0603cbb0-74ec-4e5a-b811-6eb320376144
Ancestors: KernelTests-ar.136

Change DependentArrayTest>>testCanDiscardEdits to use a PluggableTextMorph if MVC StringHolderView is not available (i.e. if MVC has been unloaded)

=============== Diff against KernelTests-ar.136 ===============

Item was changed:
  ----- Method: DependentsArrayTest>>testCanDiscardEdits (in category 'testing') -----
  testCanDiscardEdits
  "self debug: #testCanDiscardEdits."
 
  | anObject aView  |
  anObject := Object new.
+ (Smalltalk hasClassNamed: #StringHolderView)
+ ifTrue: ["Use MVC view if available"
+ aView := StringHolderView new
+ model: Transcript;
+ window: (0@0 extent: 60@60);
+ borderWidth: 1.]
+ ifFalse: ["Otherwise use a Morphic view"
+ aView := PluggableTextMorph new model: Transcript].
+ self assert: aView notNil. "require either a StringHolderView or PluggableTextMorph"
  aView := StringHolderView new
  model: Transcript;
  window: (0@0 extent: 60@60);
  borderWidth: 1.
+ aView := PluggableTextMorph new model: Transcript.
  aView hasUnacceptedEdits: true.
  anObject addDependent: Object new. "this entry should be garbage collected"
  anObject addDependent: aView.
 
  Smalltalk garbageCollect. "force garbage collection"
 
  self
  should: [anObject dependents size = 1]
  description: 'first dependent of anObject should have been collected, second should not'.
 
  self
  shouldnt: [anObject canDiscardEdits]
  description: 'anObject cannot discard edits because aView is a dependent of anObject and aView has unaccepted edits'.!