smparkes-envjs 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/README +25 -13
- data/bin/jquery-1.3.2-test.js +7 -6
- data/bin/test-jquery.sh +2 -2
- data/lib/envjs/env.js +11043 -92
- data/lib/envjs/runtime.rb +22 -1
- data/test/call-load-test.js +1 -1
- data/test/envjs-call-load-test.js +2 -0
- data/test/envjs-prototype.js +2 -0
- data/test/html/malformed.html +180 -0
- data/test/index.html +4 -1
- data/test/rhino-prototype.js +5 -0
- data/test/unit/dom.js +2 -1
- data/test/unit/elementmembers.js +1 -1
- data/test/unit/iframe.js +1 -1
- data/test/unit/onload.js +9 -3
- metadata +4 -10
- data/lib/envjs/runtime.rb.smp +0 -133
- data/test/qunit/qunit/qunit.js.smp +0 -1002
- data/test/qunit.smp/package.json +0 -21
- data/test/qunit.smp/qunit/qunit.css +0 -17
- data/test/qunit.smp/qunit/qunit.js +0 -997
- data/test/qunit.smp/test/index.html +0 -17
- data/test/qunit.smp/test/same.js +0 -1368
- data/test/qunit.smp/test/test.js +0 -136
data/test/qunit.smp/test/test.js
DELETED
@@ -1,136 +0,0 @@
|
|
1
|
-
test("module without setup/teardown (default)", function() {
|
2
|
-
expect(1);
|
3
|
-
ok(true);
|
4
|
-
});
|
5
|
-
|
6
|
-
test("expect in test", 3, function() {
|
7
|
-
ok(true);
|
8
|
-
ok(true);
|
9
|
-
ok(true);
|
10
|
-
});
|
11
|
-
|
12
|
-
test("expect in test", 1, function() {
|
13
|
-
ok(true);
|
14
|
-
});
|
15
|
-
|
16
|
-
module("setup test", {
|
17
|
-
setup: function() {
|
18
|
-
ok(true);
|
19
|
-
}
|
20
|
-
});
|
21
|
-
|
22
|
-
test("module with setup", function() {
|
23
|
-
expect(2);
|
24
|
-
ok(true);
|
25
|
-
});
|
26
|
-
|
27
|
-
var state;
|
28
|
-
|
29
|
-
module("setup/teardown test", {
|
30
|
-
setup: function() {
|
31
|
-
state = true;
|
32
|
-
ok(true);
|
33
|
-
},
|
34
|
-
teardown: function() {
|
35
|
-
ok(true);
|
36
|
-
}
|
37
|
-
});
|
38
|
-
|
39
|
-
test("module with setup/teardown", function() {
|
40
|
-
expect(3);
|
41
|
-
ok(true);
|
42
|
-
});
|
43
|
-
|
44
|
-
module("setup/teardown test 2");
|
45
|
-
|
46
|
-
test("module without setup/teardown", function() {
|
47
|
-
expect(1);
|
48
|
-
ok(true);
|
49
|
-
});
|
50
|
-
|
51
|
-
if (typeof setTimeout !== 'undefined') {
|
52
|
-
state = 'fail';
|
53
|
-
|
54
|
-
module("teardown and stop", {
|
55
|
-
teardown: function() {
|
56
|
-
equals(state, "done", "Test teardown.");
|
57
|
-
}
|
58
|
-
});
|
59
|
-
|
60
|
-
test("teardown must be called after test ended", function() {
|
61
|
-
expect(1);
|
62
|
-
stop();
|
63
|
-
setTimeout(function() {
|
64
|
-
state = "done";
|
65
|
-
start();
|
66
|
-
}, 13);
|
67
|
-
});
|
68
|
-
} // end setTimeout tests
|
69
|
-
|
70
|
-
if (typeof asyncTest !== 'undefined') {
|
71
|
-
module("asyncTest");
|
72
|
-
|
73
|
-
asyncTest("asyncTest", function() {
|
74
|
-
expect(2);
|
75
|
-
ok(true);
|
76
|
-
setTimeout(function() {
|
77
|
-
state = "done";
|
78
|
-
ok(true);
|
79
|
-
start();
|
80
|
-
}, 13);
|
81
|
-
});
|
82
|
-
|
83
|
-
asyncTest("asyncTest", 2, function() {
|
84
|
-
ok(true);
|
85
|
-
setTimeout(function() {
|
86
|
-
state = "done";
|
87
|
-
ok(true);
|
88
|
-
start();
|
89
|
-
}, 13);
|
90
|
-
});
|
91
|
-
} // end asyncTest tests
|
92
|
-
|
93
|
-
module("save scope", {
|
94
|
-
setup: function() {
|
95
|
-
this.foo = "bar";
|
96
|
-
},
|
97
|
-
teardown: function() {
|
98
|
-
same(this.foo, "bar");
|
99
|
-
}
|
100
|
-
});
|
101
|
-
test("scope check", function() {
|
102
|
-
expect(2);
|
103
|
-
same(this.foo, "bar");
|
104
|
-
});
|
105
|
-
|
106
|
-
module("simple testEnvironment setup", {
|
107
|
-
foo: "bar",
|
108
|
-
bugid: "#5311" // example of meta-data
|
109
|
-
});
|
110
|
-
test("scope check", function() {
|
111
|
-
same(this.foo, "bar");
|
112
|
-
});
|
113
|
-
test("modify testEnvironment",function() {
|
114
|
-
this.foo="hamster";
|
115
|
-
});
|
116
|
-
test("testEnvironment reset for next test",function() {
|
117
|
-
same(this.foo, "bar");
|
118
|
-
});
|
119
|
-
|
120
|
-
module("testEnvironment with object", {
|
121
|
-
options:{
|
122
|
-
recipe:"soup",
|
123
|
-
ingredients:["hamster","onions"]
|
124
|
-
}
|
125
|
-
});
|
126
|
-
test("scope check", function() {
|
127
|
-
same(this.options, {recipe:"soup",ingredients:["hamster","onions"]}) ;
|
128
|
-
});
|
129
|
-
test("modify testEnvironment",function() {
|
130
|
-
// since we do a shallow copy, the testEnvironment can be modified
|
131
|
-
this.options.ingredients.push("carrots");
|
132
|
-
});
|
133
|
-
test("testEnvironment reset for next test",function() {
|
134
|
-
same(this.options, {recipe:"soup",ingredients:["hamster","onions","carrots"]}, "Is this a bug or a feature? Could do a deep copy") ;
|
135
|
-
});
|
136
|
-
|