Permalink
Browse files

re-branding as "stylus"

  • Loading branch information...
1 parent 0761b6c commit a84ccc6907bc9e11461619776a8bc872d13806db @tj tj committed Dec 28, 2010
Showing with 56 additions and 56 deletions.
  1. +1 −1 index.js
  2. +1 −1 lib/lexer.js
  3. +1 −1 lib/parser.js
  4. +1 −1 lib/renderer.js
  5. 0 lib/{css.js → stylus.js}
  6. +1 −1 test/integration/test.js
  7. +0 −51 test/unit/css.test.js
  8. +51 −0 test/unit/stylus.test.js
View
@@ -1,2 +1,2 @@
-module.exports = require('./lib/css');
+module.exports = require('./lib/stylus');
View
@@ -227,7 +227,7 @@ var color = new RegExp('^(' + Object.keys(colors).join('|') + ')(\\()? *')
var Lexer = module.exports = function Lexer(str, options) {
options = options || {};
this.str = str.replace(/\r\n?/g, '\n').replace(/\t/g, ' ');
- this.filename = options.filename || 'css';
+ this.filename = options.filename || 'stylus';
this.stash = [];
this.prevIndents = 0;
this.lineno = 1;
View
@@ -24,7 +24,7 @@ var Lexer = require('./lexer')
var Parser = module.exports = function Parser(str, options) {
options = options || {};
this.str = str;
- this.filename = options.filename || 'css';
+ this.filename = options.filename || 'stylus';
this.lexer = new Lexer(str, options);
this.lexer.isSelector = true;
};
View
@@ -27,7 +27,7 @@ var Renderer = module.exports = function Renderer(str, options) {
options.functions = {};
this.options = options;
this.str = str;
- this.filename = options.filename || 'css';
+ this.filename = options.filename || 'stylus';
this.parser = new Parser(str, options);
};
File renamed without changes.
View
@@ -3,7 +3,7 @@
* Module dependencies.
*/
-var css = require('../../lib/css')
+var css = require('../../')
, should = require('../../support/should')
, basename = require('path').basename
, fs = require('fs');
View
@@ -1,51 +0,0 @@
-
-/**
- * Module dependencies.
- */
-
-var css = require('css')
- , should = require('should');
-
-module.exports = {
- 'test .version': function(){
- css.version.should.match(/^\d+\.\d+\.\d+$/);
- },
-
- 'test .nodes': function(){
- css.should.have.property('nodes');
- },
-
- 'test .functions': function(){
- css.should.have.property('functions');
- },
-
- 'test .render()': function(){
- css.render('body\n color red', {}, function(err, css){
- should.equal(null, err);
- css.should.equal('body {\n color: #f00;\n}');
- });
- },
-
- 'test .render() compress option': function(){
- css.render('body\n color red', { compress: true }, function(err, css){
- should.equal(null, err);
- css.should.equal('body{color:#f00;}');
- });
- },
-
- 'test .render() exception': function(){
- css.render('body\n color red', {}, function(err, css){
- err.message.should.equal('css:2\n 1: \'body\'\n 2: \' color red\'\n\nInvalid indentation, got 4 spaces and expected two');
- });
- css.render('body\n color red', { filename: 'foo.css' }, function(err, css){
- err.message.should.equal('foo.css:2\n 1: \'body\'\n 2: \' color red\'\n\nInvalid indentation, got one space and expected multiple of two');
- });
- },
-
- 'test .render() without options': function(){
- css.render('body\n color red', function(err, css){
- should.equal(null, err);
- css.should.equal('body {\n color: #f00;\n}');
- });
- }
-};
View
@@ -0,0 +1,51 @@
+
+/**
+ * Module dependencies.
+ */
+
+var stylus = require('stylus')
+ , should = require('should');
+
+module.exports = {
+ 'test .version': function(){
+ stylus.version.should.match(/^\d+\.\d+\.\d+$/);
+ },
+
+ 'test .nodes': function(){
+ stylus.should.have.property('nodes');
+ },
+
+ 'test .functions': function(){
+ stylus.should.have.property('functions');
+ },
+
+ 'test .render()': function(){
+ stylus.render('body\n color red', {}, function(err, stylus){
+ should.equal(null, err);
+ stylus.should.equal('body {\n color: #f00;\n}');
+ });
+ },
+
+ 'test .render() compress option': function(){
+ stylus.render('body\n color red', { compress: true }, function(err, stylus){
+ should.equal(null, err);
+ stylus.should.equal('body{color:#f00;}');
+ });
+ },
+
+ 'test .render() exception': function(){
+ stylus.render('body\n color red', {}, function(err, stylus){
+ err.message.should.equal('stylus:2\n 1: \'body\'\n 2: \' color red\'\n\nInvalid indentation, got 4 spaces and expected two');
+ });
+ stylus.render('body\n color red', { filename: 'foo.stylus' }, function(err, stylus){
+ err.message.should.equal('foo.stylus:2\n 1: \'body\'\n 2: \' color red\'\n\nInvalid indentation, got one space and expected multiple of two');
+ });
+ },
+
+ 'test .render() without options': function(){
+ stylus.render('body\n color red', function(err, stylus){
+ should.equal(null, err);
+ stylus.should.equal('body {\n color: #f00;\n}');
+ });
+ }
+};

0 comments on commit a84ccc6

Please sign in to comment.