Permalink
Browse files

* Some reorganization, adding JSTD-Jasmine-Adapter by Olmo Maldonado!

  • Loading branch information...
1 parent aec1154 commit e8b9157210c586c3d6c6cf88e0a42d9ebb4f1a8a @cpojer cpojer committed Jul 21, 2010
View
@@ -0,0 +1,3 @@
+[submodule "JSTD-Adapter"]
+ path = JSTD-Adapter
+ url = git://github.com/cpojer/jasmine-jstd-adapter.git
View
@@ -86,7 +86,7 @@ describe('typeOf', {
},
"should return 'elements' for Elements": function(){
- value_of(typeOf(new Elements)).should_be('elements');
+ if ('Elements' in window) value_of(typeOf(new Elements)).should_be('elements');
},
"should return 'window' for the window object": function(){
View
@@ -0,0 +1,44 @@
+var value_of = expect;
+
+jasmine.Matchers.prototype.should_be = jasmine.Matchers.prototype.toEqual;
+jasmine.Matchers.prototype.should_not_be = jasmine.Matchers.prototype.toNotEqual;
+
+jasmine.Matchers.prototype.should_be_true = jasmine.Matchers.prototype.toBeTruthy;
+jasmine.Matchers.prototype.should_be_false = jasmine.Matchers.prototype.toBeFalsy;
+jasmine.Matchers.prototype.should_be_null = jasmine.Matchers.prototype.toBeNull;
+jasmine.Matchers.prototype.should_match = jasmine.Matchers.prototype.toMatch;
+jasmine.Matchers.prototype.should_be_empty = function(){
+ return !this.actual || (this.actual.length == 0);
+};
+
+describe = (function(original){
+ var each = 'before each',
+ all = 'before all',
+ after = 'after all';
+
+ return function(name, object){
+ original(name, function(){
+ var beforeAll = object[all],
+ bfEach = object[each],
+ aAll = object[after];
+
+ beforeEach(function(){
+ if (beforeAll){
+ beforeAll();
+ beforeAll = null;
+ }
+
+ if (bfEach) bfEach();
+ });
+
+ delete object[all];
+ delete object[each];
+ delete object[after];
+
+ for (var key in object)
+ it(key, object[key]);
+
+ if (aAll) it('cleans up', aAll);
+ });
+ };
+})(describe);
File renamed without changes.
File renamed without changes.
Submodule JSTD-Adapter added at 8b53f1
View
@@ -10,8 +10,6 @@
<script type="text/javascript" src="Jasmine/jasmine.js"></script>
-<script type="text/javascript" src="jasmine-html.js"></script>
-
<!-- MooTools -->
<script src="../Source/Core/Core.js" type="text/javascript"></script>
@@ -52,58 +50,15 @@
<!-- Specs -->
-<script type="text/javascript" charset="utf-8" src="Loader.js"></script>
+<script type="text/javascript" src="Helpers/jasmine-html.js"></script>
+<script type="text/javascript" charset="utf-8" src="Helpers/JSSpecToJasmine.js"></script>
+<script type="text/javascript" charset="utf-8" src="Helpers/Loader.js"></script>
<script type="text/javascript" charset="utf-8" src="Sets.js"></script>
<script type="text/javascript" charset="utf-8">
var SpecNames = [],
Name = 'MooTools-Core-1.3';
-var value_of = expect;
-
-jasmine.Matchers.prototype.should_be = jasmine.Matchers.prototype.toEqual;
-jasmine.Matchers.prototype.should_not_be = jasmine.Matchers.prototype.toNotEqual;
-
-jasmine.Matchers.prototype.should_be_true = jasmine.Matchers.prototype.toBeTruthy;
-jasmine.Matchers.prototype.should_be_false = jasmine.Matchers.prototype.toBeFalsy;
-jasmine.Matchers.prototype.should_be_null = jasmine.Matchers.prototype.toBeNull;
-jasmine.Matchers.prototype.should_match = jasmine.Matchers.prototype.toMatch;
-jasmine.Matchers.prototype.should_be_empty = function(){
- return !this.actual || (this.actual.length == 0);
-};
-
-describe = (function(original){
- var each = 'before each',
- all = 'before all',
- after = 'after all';
-
- return function(name, object){
- original(name, function(){
- var beforeAll = object[all],
- bfEach = object[each],
- aAll = object[after];
-
- beforeEach(function(){
- if (beforeAll){
- beforeAll();
- beforeAll = null;
- }
-
- if (bfEach) bfEach();
- });
-
- delete object[all];
- delete object[each];
- delete object[after];
-
- for (var key in object)
- it(key, object[key]);
-
- if (aAll) it('cleans up', aAll);
- });
- };
-})(describe);
-
loadSpecs(Sets);
window.onload = function(){

0 comments on commit e8b9157

Please sign in to comment.