From fd822bdaf9d04e522aaa5400b673f333190abe98 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Fri, 7 Oct 2011 11:27:49 -0700 Subject: chore(formating): clean code to be function() { --- docs/spec/domSpec.js | 12 +++---- docs/spec/ngdocSpec.js | 92 ++++++++++++++++++++++++------------------------ docs/spec/sitemapSpec.js | 6 ++-- docs/spec/specs.js | 2 +- docs/spec/writerSpec.js | 10 +++--- 5 files changed, 61 insertions(+), 61 deletions(-) (limited to 'docs/spec') diff --git a/docs/spec/domSpec.js b/docs/spec/domSpec.js index 3fda656f..45813cc4 100644 --- a/docs/spec/domSpec.js +++ b/docs/spec/domSpec.js @@ -1,15 +1,15 @@ var DOM = require('dom.js').DOM; -describe('dom', function(){ +describe('dom', function() { var dom; - beforeEach(function(){ + beforeEach(function() { dom = new DOM(); }); - describe('h', function(){ + describe('h', function() { - it('should render using function', function(){ + it('should render using function', function() { var cbThis; var cdValue; dom.h('heading', 'content', function(value){ @@ -20,8 +20,8 @@ describe('dom', function(){ expect(cbValue).toEqual('content'); }); - it('should update heading numbers', function(){ - dom.h('heading', function(){ + it('should update heading numbers', function() { + dom.h('heading', function() { this.html('
\n<>\n
after
'); }); - it('should preserve the jsfiddle attribute', function(){ + it('should preserve the jsfiddle attribute', function() { var doc = new Doc('@description beforelala
after
'); }); - it('should escape<angular/>
'); }); - it('should not replace anything in, but escape the html escape the content', function(){
+ it('should not replace anything in , but escape the html escape the content', function() {
expect(new Doc().markdown('bah x\n\nangular.k\n
\n asdf x')).
toEqual(
'bah x
' +
@@ -234,19 +234,19 @@ describe('ngdoc', function(){
});
- describe('trim', function(){
+ describe('trim', function() {
var trim = ngdoc.trim;
- it('should remove leading/trailing space', function(){
+ it('should remove leading/trailing space', function() {
expect(trim(' \nabc\n ')).toEqual('abc');
});
- it('should remove leading space on every line', function(){
+ it('should remove leading space on every line', function() {
expect(trim('\n 1\n 2\n 3\n')).toEqual('1\n 2\n 3');
});
});
- describe('merge', function(){
- it('should merge child with parent', function(){
+ describe('merge', function() {
+ it('should merge child with parent', function() {
var parent = new Doc({id: 'angular.service.abc', name: 'angular.service.abc', section: 'api'});
var methodA = new Doc({name: 'methodA', methodOf: 'angular.service.abc'});
var methodB = new Doc({name: 'methodB', methodOf: 'angular.service.abc'});
@@ -294,9 +294,9 @@ describe('ngdoc', function(){
////////////////////////////////////////
- describe('TAG', function(){
- describe('@param', function(){
- it('should parse with no default', function(){
+ describe('TAG', function() {
+ describe('@param', function() {
+ it('should parse with no default', function() {
var doc = new Doc('@param {(number|string)} number Number \n to format.');
doc.parse();
expect(doc.param).toEqual([{
@@ -307,7 +307,7 @@ describe('ngdoc', function(){
description : 'Number \nto format.
' }]);
});
- it('should parse with default and optional', function(){
+ it('should parse with default and optional', function() {
var doc = new Doc('@param {(number|string)=} [fractionSize=2] desc');
doc.parse();
expect(doc.param).toEqual([{
@@ -397,8 +397,8 @@ describe('ngdoc', function(){
});
});
- describe('@description', function(){
- it('should support pre blocks', function(){
+ describe('@description', function() {
+ it('should support pre blocks', function() {
var doc = new Doc("@description abc
");
doc.parse();
expect(doc.description).
@@ -442,7 +442,7 @@ describe('ngdoc', function(){
toContain('./static.html');
});
- it('should support line breaks in @link', function(){
+ it('should support line breaks in @link', function() {
var doc = new Doc("@description " +
'{@link\napi/angular.foo\na\nb}');
doc.parse();
@@ -452,14 +452,14 @@ describe('ngdoc', function(){
});
- describe('@example', function(){
- it('should not remove {{}}', function(){
+ describe('@example', function() {
+ it('should not remove {{}}', function() {
var doc = new Doc('@example text {{ abc }}');
doc.parse();
expect(doc.example).toEqual('text {{ abc }}
');
});
- it('should support doc:example', function(){
+ it('should support doc:example', function() {
var doc = new Doc('@ngdoc overview\n@example \n' +
'\n' +
' \n' +
@@ -480,7 +480,7 @@ describe('ngdoc', function(){
});
});
- describe('@this', function(){
+ describe('@this', function() {
it('should render @this', function() {
var doc = new Doc('@this I am self.');
doc.ngdoc = 'filter';
@@ -495,9 +495,9 @@ describe('ngdoc', function(){
});
});
- describe('usage', function(){
- describe('overview', function(){
- it('should supress description heading', function(){
+ describe('usage', function() {
+ describe('overview', function() {
+ it('should supress description heading', function() {
var doc = new Doc('@ngdoc overview\n@name angular\n@description\n#heading\ntext');
doc.parse();
expect(doc.html()).toContain('text');
@@ -507,8 +507,8 @@ describe('ngdoc', function(){
});
- describe('function', function(){
- it('should format', function(){
+ describe('function', function() {
+ it('should format', function() {
var doc = new Doc({
ngdoc:'function',
name:'some.name',
@@ -527,8 +527,8 @@ describe('ngdoc', function(){
});
});
- describe('filter', function(){
- it('should format', function(){
+ describe('filter', function() {
+ it('should format', function() {
var doc = new Doc({
ngdoc:'formatter',
shortName:'myFilter',
@@ -543,8 +543,8 @@ describe('ngdoc', function(){
});
});
- describe('property', function(){
- it('should format', function(){
+ describe('property', function() {
+ it('should format', function() {
var doc = new Doc({
ngdoc:'property',
name:'myProp',
diff --git a/docs/spec/sitemapSpec.js b/docs/spec/sitemapSpec.js
index b14d58bf..dc6c3438 100644
--- a/docs/spec/sitemapSpec.js
+++ b/docs/spec/sitemapSpec.js
@@ -2,8 +2,8 @@ var SiteMap = require('SiteMap.js').SiteMap;
var Doc = require('ngdoc.js').Doc;
-describe('sitemap', function(){
- it('should render empty sitemap', function(){
+describe('sitemap', function() {
+ it('should render empty sitemap', function() {
var map = new SiteMap([]);
expect(map.render()).toEqual([
'',
@@ -11,7 +11,7 @@ describe('sitemap', function(){
'', ''].join('\n'));
});
- it('should render ngdoc url', function(){
+ it('should render ngdoc url', function() {
var map = new SiteMap([new Doc({section: 'foo', id: 'a.b.c<>\'"&'})]);
expect(map.render()).toContain([
' ',
diff --git a/docs/spec/specs.js b/docs/spec/specs.js
index a6ba17a9..7f9f92ee 100644
--- a/docs/spec/specs.js
+++ b/docs/spec/specs.js
@@ -10,7 +10,7 @@ for(var key in jasmine) {
}
//Patch Jasmine for proper stack traces
-jasmine.Spec.prototype.fail = function (e) {
+jasmine.Spec.prototype.fail = function(e) {
var expectationResult = new jasmine.ExpectationResult({
passed: false,
message: e ? jasmine.util.formatException(e) : 'Exception'
diff --git a/docs/spec/writerSpec.js b/docs/spec/writerSpec.js
index a44e283c..973bb64e 100644
--- a/docs/spec/writerSpec.js
+++ b/docs/spec/writerSpec.js
@@ -1,17 +1,17 @@
var writer = require('writer.js');
-describe('writer', function(){
- describe('toString', function(){
+describe('writer', function() {
+ describe('toString', function() {
var toString = writer.toString;
- it('should merge string', function(){
+ it('should merge string', function() {
expect(toString('abc')).toEqual('abc');
});
- it('should merge obj', function(){
+ it('should merge obj', function() {
expect(toString({a:1})).toEqual('{"a":1}');
});
- it('should merge array', function(){
+ it('should merge array', function() {
expect(toString(['abc',{}])).toEqual('abc{}');
});
});
--
cgit v1.2.3