Browse Source

Clarifications

Herbert Vojčík 11 years ago
parent
commit
8ff78c754c
2 changed files with 26 additions and 3 deletions
  1. 17 1
      js/Kernel-Tests.js
  2. 9 2
      st/Kernel-Tests.st

+ 17 - 1
js/Kernel-Tests.js

@@ -1350,6 +1350,22 @@ referencedClasses: []
 }),
 smalltalk.CollectionTest);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "collectionWithNewValue",
+protocol: 'fixture',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self._subclassResponsibility();
+return self}, function($ctx1) {$ctx1.fill(self,"collectionWithNewValue",{},smalltalk.CollectionTest)})},
+args: [],
+source: "collectionWithNewValue\x0a\x09\x22Answers a collection which shows how\x0a\x09self collection would look after adding\x0a\x09self sampleNewValue\x22\x0a\x09\x0a\x09self subclassResponsibility",
+messageSends: ["subclassResponsibility"],
+referencedClasses: []
+}),
+smalltalk.CollectionTest);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isCollectionReadOnly",
@@ -1394,7 +1410,7 @@ $1=_st(self._collectionClass())._with_(self._sampleNewValue());
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"sampleNewValueAsCollection",{},smalltalk.CollectionTest)})},
 args: [],
-source: "sampleNewValueAsCollection\x0a\x09\x22Answers a value that is not yet there\x0a\x09and can be put into a tested collection,\x0a\x09wrapped in single element collection\x0a\x09of tested type\x22\x0a\x09\x0a\x09^ self collectionClass with: self sampleNewValue",
+source: "sampleNewValueAsCollection\x0a\x09\x22Answers self sampleNewValue\x0a\x09wrapped in single element collection\x0a\x09of tested type\x22\x0a\x09\x0a\x09^ self collectionClass with: self sampleNewValue",
 messageSends: ["with:", "collectionClass", "sampleNewValue"],
 referencedClasses: []
 }),

+ 9 - 2
st/Kernel-Tests.st

@@ -425,6 +425,14 @@ collectionWithDuplicates
 	self subclassResponsibility
 !
 
+collectionWithNewValue
+	"Answers a collection which shows how
+	self collection would look after adding
+	self sampleNewValue"
+	
+	self subclassResponsibility
+!
+
 sampleNewValue
 	"Answers a value that is not yet there
 	and can be put into a tested collection"
@@ -433,8 +441,7 @@ sampleNewValue
 !
 
 sampleNewValueAsCollection
-	"Answers a value that is not yet there
-	and can be put into a tested collection,
+	"Answers self sampleNewValue
 	wrapped in single element collection
 	of tested type"