X Tutup
Skip to content

Commit 595b4ea

Browse files
committed
checkpoint for integration with angular
1 parent 27709c3 commit 595b4ea

File tree

14 files changed

+2376
-156
lines changed

14 files changed

+2376
-156
lines changed

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ task :compile do
3434
concat = %x(cat \
3535
src/angular.prefix \
3636
lib/webtoolkit/webtoolkit.base64.js \
37-
src/Loader.js \
37+
src/Angular.js \
3838
src/API.js \
3939
src/Binder.js \
4040
src/ControlBar.js \

css/angular.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ div.ui-widget {
6363
background-repeat: no-repeat;
6464
background-position: right;
6565
}
66-
.ng-ascend { background-image: url(images/arrow_ascend.png); }
67-
.ng-descend { background-image: url(images/arrow_descend.png); }
66+
.ng-ascend { background-image: url(angular_images/arrow_ascend.png); }
67+
.ng-descend { background-image: url(angular_images/arrow_descend.png); }
6868

6969
/*****************
7070
* TIP
@@ -83,7 +83,7 @@ div.ui-widget {
8383
}
8484

8585
#ng-callout .ng-arrow-left{
86-
background-image: url(images/arrow_left.gif);
86+
background-image: url(angular_images/arrow_left.gif);
8787
background-repeat: no-repeat;
8888
background-position: left top;
8989
position: absolute;
@@ -95,7 +95,7 @@ div.ui-widget {
9595
}
9696

9797
#ng-callout .ng-arrow-right{
98-
background-image: url(images/arrow_right.gif);
98+
background-image: url(angular_images/arrow_right.gif);
9999
background-repeat: no-repeat;
100100
background-position: left top;
101101
position: absolute;

jsTestDriver.conf

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ load:
55
- lib/jquery/jquery-1.3.2.js
66
- lib/jquery/jquery-ui-1.7.1.custom.min.js
77
- lib/underscore/underscore.js
8-
- src/Loader.js
8+
- src/Angular.js
99
- src/*.js
1010
- src/test/_namespace.js
1111
- src/test/*.js
@@ -14,7 +14,5 @@ load:
1414
- test/*.js
1515

1616
exclude:
17-
- src/angular-bootstrap.js
1817
- src/angular.prefix
1918
- src/angular.suffix
20-
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
/**
2+
* @fileoverview Jasmine JsTestDriver Adapter.
3+
* @author ibolmo@gmail.com (Olmo Maldonado)
4+
*/
5+
6+
(function() {
7+
8+
// Suite/TestCase before and after function stacks.
9+
var before = [];
10+
var after = [];
11+
12+
jasmine.Env.prototype.describe = (function(describe){
13+
14+
// TODO(ibolmo): Support nested describes.
15+
return function(description, specDefinitions){
16+
this.currentTestCase = TestCase(description);
17+
return describe.call(this, description, specDefinitions);
18+
};
19+
20+
})(jasmine.Env.prototype.describe);
21+
22+
23+
jasmine.Env.prototype.it = (function(it){
24+
25+
return function(desc, func){
26+
var spec = it.call(this, desc, func);
27+
this.currentTestCase.prototype['test that it ' + desc] = func;
28+
return spec;
29+
};
30+
31+
})(jasmine.Env.prototype.it);
32+
33+
34+
jasmine.Env.prototype.beforeEach = (function(beforeEach){
35+
36+
// TODO(ibolmo): Support beforeEach TestCase.
37+
return function(beforeEachFunction) {
38+
beforeEach.call(this, beforeEachFunction);
39+
if (this.currentTestCase) {
40+
this.currentTestCase.prototype.setUp = beforeEachFunction;
41+
} else {
42+
before.push(beforeEachFunction);
43+
}
44+
};
45+
46+
})(jasmine.Env.prototype.beforeEach);
47+
48+
49+
jasmine.Env.prototype.afterEach = (function(afterEach){
50+
51+
// TODO(ibolmo): Support afterEach TestCase.
52+
return function(afterEachFunction) {
53+
afterEach.call(this, afterEachFunction);
54+
if (this.currentTestCase) {
55+
this.currentTestCase.prototype.tearDown = afterEachFunction;
56+
} else {
57+
after.push(afterEachFunction);
58+
}
59+
};
60+
61+
})(jasmine.Env.prototype.afterEach);
62+
63+
64+
jasmine.NestedResults.prototype.addResult = (function(addResult){
65+
66+
return function(result) {
67+
addResult.call(this, result);
68+
if (result.type != 'MessageResult' && !result.passed()) fail(result.message);
69+
};
70+
71+
})(jasmine.NestedResults.prototype.addResult);
72+
73+
74+
jstestdriver.plugins.TestRunnerPlugin.prototype.runTestConfiguration = (function(runTestConfiguration){
75+
76+
return function(testRunConfiguration, onTestDone, onTestRunConfigurationComplete){
77+
for (var i = 0, l = before.length; i < l; i++) before[i]();
78+
onTestRunConfigurationComplete = (function(configurationComplete){
79+
80+
return function() {
81+
for (var i = 0, l = after.length; i < l; i++) after[i]();
82+
configurationComplete();
83+
};
84+
85+
})(onTestRunConfigurationComplete);
86+
runTestConfiguration.call(this, testRunConfiguration, onTestDone, onTestRunConfigurationComplete);
87+
};
88+
89+
})(jstestdriver.plugins.TestRunnerPlugin.prototype.runTestConfiguration);
90+
91+
92+
// Reset environment with overriden methods.
93+
jasmine.currentEnv_ = null;
94+
jasmine.getEnv();
95+
96+
})();

0 commit comments

Comments
 (0)
X Tutup