Browse Source

Fixed all the tests to run in nodejs

Nicolas Petton 12 years ago
parent
commit
47288f639d
6 changed files with 1338 additions and 1429 deletions
  1. 318 303
      js/Kernel-Objects.deploy.js
  2. 314 292
      js/Kernel-Objects.js
  3. 347 411
      js/Kernel-Tests.deploy.js
  4. 347 411
      js/Kernel-Tests.js
  5. 4 0
      st/Kernel-Objects.st
  6. 8 12
      st/Kernel-Tests.st

File diff suppressed because it is too large
+ 318 - 303
js/Kernel-Objects.deploy.js


File diff suppressed because it is too large
+ 314 - 292
js/Kernel-Objects.js


File diff suppressed because it is too large
+ 347 - 411
js/Kernel-Tests.deploy.js


File diff suppressed because it is too large
+ 347 - 411
js/Kernel-Tests.js


+ 4 - 0
st/Kernel-Objects.st

@@ -200,6 +200,10 @@ subclassResponsibility
 	self error: 'This method is a responsibility of a subclass'
 	self error: 'This method is a responsibility of a subclass'
 !
 !
 
 
+throw: anObject
+	< throw anObject >
+!
+
 try: aBlock catch: anotherBlock
 try: aBlock catch: anotherBlock
 	<try{result = aBlock()} catch(e) {result = anotherBlock(e)};
 	<try{result = aBlock()} catch(e) {result = anotherBlock(e)};
 	return result;>
 	return result;>

+ 8 - 12
st/Kernel-Tests.st

@@ -816,7 +816,7 @@ TestCase subclass: #JSObjectProxyTest
 !JSObjectProxyTest methodsFor: 'accessing'!
 !JSObjectProxyTest methodsFor: 'accessing'!
 
 
 jsObject
 jsObject
-	<return jsObject = {a: 1, b: function() {return 2;}, c: function(object) {return object;}}>
+	<return jsObject = {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: ''}>
 ! !
 ! !
 
 
 !JSObjectProxyTest methodsFor: 'tests'!
 !JSObjectProxyTest methodsFor: 'tests'!
@@ -833,13 +833,7 @@ testMessageSend
 !
 !
 
 
 testMethodWithArguments
 testMethodWithArguments
-	self deny: ('body' asJQuery hasClass: 'amber').
-
-	'body' asJQuery addClass: 'amber'.
-	self assert: ('body' asJQuery hasClass: 'amber').
-
-	'body' asJQuery removeClass: 'amber'.
-	self deny: ('body' asJQuery hasClass: 'amber').
+	self assert: (self jsObject c: 1) equals: 1
 !
 !
 
 
 testPrinting
 testPrinting
@@ -847,11 +841,13 @@ testPrinting
 !
 !
 
 
 testPropertyThatReturnsEmptyString
 testPropertyThatReturnsEmptyString
-	<document.location.hash = ''>.
-	self assert: '' equals: document location hash.
+	| object |
+
+	object := self jsObject.
+	self assert: '' equals: object d.
 
 
-	document location hash: 'test'.
-	self assert: '#test' equals: document location hash.
+	object d: 'hello'.
+	self assert: 'hello' equals: object d
 !
 !
 
 
 testYourself
 testYourself

Some files were not shown because too many files changed in this diff