From 0f43b246b4ef5c1759c81440e8b0b2abbf9230d3 Mon Sep 17 00:00:00 2001 From: Jessica Lord Date: Wed, 1 Apr 2015 12:04:11 -0700 Subject: [PATCH 1/3] add styleguide for specs --- CONTRIBUTING.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d2cf02bef..a6736e11b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,7 +48,7 @@ For more information on how to work with Atom's official packages, see [JavaScript](https://github.com/styleguide/javascript), and [CSS](https://github.com/styleguide/css) styleguides. * Include thoughtfully-worded, well-structured - [Jasmine](http://jasmine.github.io/) specs in the `./spec` folder. Run them using `apm test`. + [Jasmine](http://jasmine.github.io/) specs in the `./spec` folder. Run them using `apm test`. See the [Specs Styleguide](#specs-styleguide) below. * Document new code based on the [Documentation Styleguide](#documentation-styleguide) * End files with a newline. @@ -108,6 +108,24 @@ For more information on how to work with Atom's official packages, see * Add an explicit `return` when your function ends with a `for`/`while` loop and you don't want it to return a collected array. +## Specs Styleguide + +- Include thoughtfully-worded, well-structured + [Jasmine](http://jasmine.github.io/) specs in the `./spec` folder. +- treat `describe` as a noun or situation. +- trea `it` as a statement about state or how an operation changes state. + +### Example + +```coffee +describe 'a dog' + it 'barks' + # spec here + describe 'when the dog is happy' + it 'wags its tail' + # spec here +``` + ## Documentation Styleguide * Use [AtomDoc](https://github.com/atom/atomdoc). From 293b34e2a4175f0f964cc796d7259822f97a0dd3 Mon Sep 17 00:00:00 2001 From: Jessica Lord Date: Wed, 1 Apr 2015 12:10:02 -0700 Subject: [PATCH 2/3] typo --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a6736e11b..88c0ffa47 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -113,7 +113,7 @@ For more information on how to work with Atom's official packages, see - Include thoughtfully-worded, well-structured [Jasmine](http://jasmine.github.io/) specs in the `./spec` folder. - treat `describe` as a noun or situation. -- trea `it` as a statement about state or how an operation changes state. +- treat `it` as a statement about state or how an operation changes state. ### Example From 2bfdb5d7770288a627f0242da24b86a6e40056dd Mon Sep 17 00:00:00 2001 From: Jessica Lord Date: Wed, 1 Apr 2015 14:37:42 -0700 Subject: [PATCH 3/3] add syntax --- CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 88c0ffa47..9041b3fcd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -118,11 +118,11 @@ For more information on how to work with Atom's official packages, see ### Example ```coffee -describe 'a dog' - it 'barks' +describe 'a dog', -> + it 'barks', -> # spec here - describe 'when the dog is happy' - it 'wags its tail' + describe 'when the dog is happy', -> + it 'wags its tail', -> # spec here ```