aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorIgor Minar2013-08-23 15:41:47 -0700
committerIgor Minar2013-08-23 15:46:11 -0700
commit1d06a943857719ef533ca374c05aa5e02089a4d9 (patch)
tree4b8b0b4b6e263dd0da7211052ae0c5047fcc78a9 /test
parent7c605ddf1c57c9f162827713ca5b0fbb12de5fa5 (diff)
downloadangular.js-1d06a943857719ef533ca374c05aa5e02089a4d9.tar.bz2
chore: reorganize test helper files under test/helpers
Diffstat (limited to 'test')
-rw-r--r--test/helpers/matchers.js (renamed from test/matchers.js)0
-rw-r--r--test/helpers/privateMocks.js28
-rw-r--r--test/helpers/privateMocksSpec.js (renamed from test/privateMocksSpec.js)0
-rw-r--r--test/helpers/testabilityPatch.js (renamed from test/testabilityPatch.js)0
4 files changed, 28 insertions, 0 deletions
diff --git a/test/matchers.js b/test/helpers/matchers.js
index 57bf35c7..57bf35c7 100644
--- a/test/matchers.js
+++ b/test/helpers/matchers.js
diff --git a/test/helpers/privateMocks.js b/test/helpers/privateMocks.js
new file mode 100644
index 00000000..6d9fb34f
--- /dev/null
+++ b/test/helpers/privateMocks.js
@@ -0,0 +1,28 @@
+function createMockStyleSheet(doc, wind) {
+ doc = doc ? doc[0] : document;
+ wind = wind || window;
+
+ var node = doc.createElement('style');
+ var head = doc.getElementsByTagName('head')[0];
+ head.appendChild(node);
+
+ var ss = doc.styleSheets[doc.styleSheets.length - 1];
+
+ return {
+ addRule : function(selector, styles) {
+ try {
+ ss.insertRule(selector + '{ ' + styles + '}', 0);
+ }
+ catch(e) {
+ try {
+ ss.addRule(selector, styles);
+ }
+ catch(e) {}
+ }
+ },
+
+ destroy : function() {
+ head.removeChild(node);
+ }
+ };
+};
diff --git a/test/privateMocksSpec.js b/test/helpers/privateMocksSpec.js
index e58a2b75..e58a2b75 100644
--- a/test/privateMocksSpec.js
+++ b/test/helpers/privateMocksSpec.js
diff --git a/test/testabilityPatch.js b/test/helpers/testabilityPatch.js
index 514a5fdb..514a5fdb 100644
--- a/test/testabilityPatch.js
+++ b/test/helpers/testabilityPatch.js