Permalink
Browse files

removing 1.2 compat layer features from the 1.3 specs

  • Loading branch information...
1 parent f4be441 commit eec4876c598f92b120012b5ad7040b943e9cb280 @fabiomcosta fabiomcosta committed Apr 11, 2010
Showing with 19 additions and 8 deletions.
  1. +1 −1 1.3public/Class/Class.js
  2. +7 −1 1.3public/Element/Element.js
  3. +3 −1 1.3public/Types/Array.js
  4. +7 −5 1.3public/Types/Function.js
  5. +1 −0 1.3public/Types/Hash.js
View
@@ -100,7 +100,7 @@ var Attributes = new Class({
describe('Class creation', {
"Classes should be of type 'class'": function(){
- value_of($type(Animal)).should_be('class');
+ value_of(typeOf(Animal)).should_be('class');
value_of(Type.isClass(Animal)).should_be_true();
},
@@ -6,11 +6,15 @@ License:
MIT-style license.
*/
+(function(){
+
+var $defined = function(obj){ return obj != null; };
+
describe('Element constructor', {
"should return an Element with the correct tag": function(){
var element = new Element('div');
- value_of($type(element)).should_be('element');
+ value_of(typeOf(element)).should_be('element');
value_of($defined(element.addEvent)).should_be_true();
value_of(element.tagName.toLowerCase()).should_be('div');
},
@@ -1635,3 +1639,5 @@ describe('Element.hasChild', {
}
});
+
+})();
View
@@ -15,6 +15,8 @@ var getTestArray = function(){
return a;
};
+var $defined = function(obj){ return obj != null; };
+
describe("Array Methods", {
@@ -179,7 +181,7 @@ describe("Array Methods", {
'should extend an array': function(){
var a = [1,2,4];
var b = [2,3,4,5];
- a.extend(b);
+ a.append(b);
value_of(a).should_be([1,2,4,2,3,4,5]);
value_of(b).should_be([2,3,4,5]);
},
@@ -8,16 +8,18 @@ License:
(function(){
+var $empty = function(){};
+
var fn = function(){
- return $A(arguments);
+ return Array.from(arguments);
};
var Rules = function(){
return this + ' rules';
};
var Args = function(){
- return [this].concat($A(arguments));
+ return [this].concat(Array.from(arguments));
};
describe("Function Methods", {
@@ -123,7 +125,7 @@ describe("Function Methods", {
},
"should return the function's return value": function(){
- var fnc = $lambda('hello world!');
+ var fnc = Function.from('hello world!');
value_of(fnc.attempt()).should_be('hello world!');
},
@@ -139,15 +141,15 @@ describe("Function Methods", {
'delay should return a timer pointer': function(){
var timer = $empty.delay(10000);
value_of(Type.isNumber(timer)).should_be_true();
- $clear(timer);
+ Function.clear(timer);
},
// Function.periodical
'periodical should return a timer pointer': function(){
var timer = $empty.periodical(10000);
value_of(Type.isNumber(timer)).should_be_true();
- $clear(timer);
+ Function.clear(timer);
}
});
View
@@ -9,6 +9,7 @@ License:
(function(){
var hash2 = new Hash({ a: 'string', b: 233, c: {} });
+var $defined = function(obj){ return obj != null; };
describe("Hash Methods", {

0 comments on commit eec4876

Please sign in to comment.