Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding some simple tests.

  • Loading branch information...
commit afdb9a91ac5d686b9e4362a4f8064e0eb1ae7b95 1 parent 55a6d61
@cohitre authored
Showing with 7,222 additions and 0 deletions.
  1. +22 −0 test/index.html
  2. +7,179 −0 test/jquery.js
  3. +21 −0 test/tests.js
View
22 test/index.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Testing</title>
+ <style type='text/css'>
+ .error {
+ background-color: red;
+ }
+ .ok {
+ background-color: green;
+ }
+ </style>
+ </head>
+ <body>
+ <div class='green-1'>initialize</div>
+ <div class='green-2'>doOnce</div>
+ <div class='red'>iff</div>
+ <script type='text/javascript' src='./jquery.js' ></script>
+ <script type='text/javascript' src='../jquery.cohitre.js' ></script>
+ <script type='text/javascript' src='./tests.js' ></script>
+ </body>
+</html>
View
7,179 test/jquery.js
7,179 additions, 0 deletions not shown
View
21 test/tests.js
@@ -0,0 +1,21 @@
+$.initialize(".green-1", function () {
+ this.addClass('ok');
+});
+
+$.initialize(".red", function () {
+ this
+ .iff(this.is('.red'))
+ .addClass('ok')
+ .end()
+ .iff(this.is('.green'))
+ .addClass('error');
+});
+
+$(function () {
+ function addClass2(klass) {
+ this.addClass(klass);
+ }
+ $(".green-2").doOnce(addClass2, 'ok');
+})
+
+$(".green-1, .green-2").addClass('ok');

0 comments on commit afdb9a9

Please sign in to comment.
Something went wrong with that request. Please try again.