Skip to content

Commit a7ad26c

Browse files
committed
Start Tests
1 parent e4cdb67 commit a7ad26c

File tree

7 files changed

+133
-1
lines changed

7 files changed

+133
-1
lines changed

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# SASS
2+
.sass-cache
3+
4+
# SublimeText
5+
/*.sublime-project
6+
*.sublime-workspace
7+
sftp-config*.json
8+
9+
# OSX
10+
.DS_Store
11+
._*
12+
.Spotlight-V100
13+
.Trashes
14+
15+
# Node
16+
node_modules
17+
npm-debug.log
18+
19+
# Test Files
20+
test/results.css

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
language: node_js
2+
node_js:
3+
- '0.8'
4+
- '0.10'
5+
before_script:
6+
- gem update --system
7+
- gem install sass
8+
- npm install -g grunt-cli

Gruntfile.coffee

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# global module: false
2+
module.exports = (grunt) ->
3+
4+
# Modules
5+
grunt.loadNpmTasks 'grunt-init'
6+
grunt.loadNpmTasks 'grunt-contrib-sass'
7+
grunt.loadNpmTasks 'grunt-contrib-watch'
8+
grunt.loadNpmTasks 'bootcamp'
9+
10+
# Grunt Tasks
11+
grunt.initConfig
12+
meta: version: '0.0.1'
13+
14+
# Sass
15+
sass: test:
16+
options:
17+
style: 'expanded'
18+
loadPath: 'node_modules/bootcamp/dist'
19+
files: './test/results.css': './test/specs.scss'
20+
21+
# Bootcamp
22+
bootcamp: dist:
23+
files: src: ['./test/results.css']
24+
25+
# Watch
26+
watch: dist:
27+
files: ['./dist/**/*.scss', './test/**/*.scss']
28+
tasks: ['sass', 'bootcamp']
29+
30+
# Tasks
31+
grunt.registerTask 'default', ['sass', 'bootcamp', 'watch']
32+
grunt.registerTask 'test', ['sass', 'bootcamp']

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,24 @@ If argument has `deg` unit, converted to `rad`.
146146
* [Degree (angle)](http://en.wikipedia.org/wiki/Degree_\(angle\)), [度 (角度)](http://ja.wikipedia.org/wiki/%E5%BA%A6_\(%E8%A7%92%E5%BA%A6\))
147147
* [Radian](http://en.wikipedia.org/wiki/Radian), [ラジアン](http://ja.wikipedia.org/wiki/%E3%83%A9%E3%82%B8%E3%82%A2%E3%83%B3)
148148

149+
## Contributing
150+
151+
Make sure you have [node.js](http://nodejs.org/) and [grunt](http://gruntjs.com/getting-started) installed.
152+
153+
**Clone Repository**
154+
```
155+
git clone git@github.com:terkel/mathsass.git
156+
```
157+
158+
**Install Dependencies***
159+
```
160+
npm install
161+
```
162+
163+
**Run Sass/Tests**
164+
```
165+
grunt
166+
```
149167

150168
## Credits
151169

@@ -154,5 +172,5 @@ Special thanks to [@kaminaly](https://github.com/kaminaly) and [@pilssalgi](http
154172

155173
## License
156174

157-
Copyright (c) 2013 [Takeru Suzuki](http://terkel.jp/)
175+
Copyright (c) 2013 [Takeru Suzuki](http://terkel.jp/)
158176
Licensed under the [MIT license](http://www.opensource.org/licenses/MIT).

package.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "mathsass",
3+
"version": "1.0.0",
4+
"description": "A Sass implementation of mathematical functions.",
5+
"main": "_math.scss",
6+
"scripts": {
7+
"test": "grunt test"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git://github.com/terkel/mathsass.git"
12+
},
13+
"keywords": [
14+
"sass",
15+
"scss",
16+
"math"
17+
],
18+
"author": "Takeru Suzuki <terkeljp@gmail.com> (https://github.com/terkel)",
19+
"readmeFilename": "README.md",
20+
"bugs": {
21+
"url": "https://github.com/terkel/mathsass/issues"
22+
},
23+
"devDependencies": {
24+
"grunt": "~0.4.1",
25+
"grunt-contrib-sass": "~0.5.0",
26+
"grunt-contrib-watch": "~0.5.3",
27+
"grunt-init": "~0.2.1",
28+
"bootcamp": "~0.0.5"
29+
}
30+
}

test/functions/pow.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@include describe("Pow") {
2+
@include it("should calculate exponents") {
3+
@include should(expect( pow(4, 2) ), to( equal( 16 )));
4+
}
5+
6+
@include it("should calculate negative exponents") {
7+
@include should(expect( pow(4, -2) ), to( equal( 0.0625 )));
8+
}
9+
10+
@include it("should calculate decimal exponents") {
11+
@include should(expect( pow(4, 0.2) ), to( be-close-to( 1.31951, 5)));
12+
}
13+
}

test/specs.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@import "bootcamp";
2+
3+
$bootcamp-setting-verbose: false;
4+
5+
@import "../math";
6+
7+
@include runner-start;
8+
9+
@import "functions/pow";
10+
11+
@include runner-end;

0 commit comments

Comments
 (0)