Skip to content

Commit

Permalink
🐎 Update test structure to match sasstools#166
Browse files Browse the repository at this point in the history
  • Loading branch information
DanPurdy committed Sep 14, 2015
1 parent 815c944 commit 25b29da
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
4 changes: 2 additions & 2 deletions lib/rules/shorthand-values.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ module.exports = {

declaration.traverse(function (item) {

if (item.type === 'property') {
if (item.is('property')) {
item.traverse(function (child) {
// check if the property is a possible shorthand property
if (shortVals.indexOf(child.content) !== -1) {
Expand All @@ -70,7 +70,7 @@ module.exports = {
if (isShorthandProperty) {
var value = [];

if (item.type === 'value') {
if (item.is('value')) {
var node = item.content,
fullVal = '';

Expand Down
26 changes: 15 additions & 11 deletions tests/rules/shorthand-values.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

var lint = require('./_lint');

var file = lint.file('shorthand-values.scss');

describe('shorthand values - scss', function () {
var file = lint.file('shorthand-values.scss');

it('[default]', function (done) {
lint.test(file, {
'shorthand-values': 1
Expand Down Expand Up @@ -147,11 +147,15 @@ describe('shorthand values - scss', function () {
});
});

/////////////////////////////
// Sass
/////////////////////////////

describe('shorthand values - sass', function () {
var file = lint.file('shorthand-values.sass');

it('[default]', function (done) {
lint.test(lint.file('shorthand-values.sass'), {
lint.test(file, {
'shorthand-values': 1
}, function (data) {
lint.assert.equal(44, data.warningCount);
Expand All @@ -160,7 +164,7 @@ describe('shorthand values - sass', function () {
});

it('[allowed: 1]', function (done) {
lint.test(lint.file('shorthand-values.sass'), {
lint.test(file, {
'shorthand-values': [
1,
{
Expand All @@ -176,7 +180,7 @@ describe('shorthand values - sass', function () {
});

it('[allowed: 2]', function (done) {
lint.test(lint.file('shorthand-values.sass'), {
lint.test(file, {
'shorthand-values': [
1,
{
Expand All @@ -192,7 +196,7 @@ describe('shorthand values - sass', function () {
});

it('[allowed: 3]', function (done) {
lint.test(lint.file('shorthand-values.sass'), {
lint.test(file, {
'shorthand-values': [
1,
{
Expand All @@ -208,7 +212,7 @@ describe('shorthand values - sass', function () {
});

it('[allowed: none]', function (done) {
lint.test(lint.file('shorthand-values.sass'), {
lint.test(file, {
'shorthand-values': [
1,
{
Expand All @@ -223,7 +227,7 @@ describe('shorthand values - sass', function () {
});

it('[allowed: 1, 2]', function (done) {
lint.test(lint.file('shorthand-values.sass'), {
lint.test(file, {
'shorthand-values': [
1,
{
Expand All @@ -240,7 +244,7 @@ describe('shorthand values - sass', function () {
});

it('[allowed: 1, 3]', function (done) {
lint.test(lint.file('shorthand-values.sass'), {
lint.test(file, {
'shorthand-values': [
1,
{
Expand All @@ -257,7 +261,7 @@ describe('shorthand values - sass', function () {
});

it('[allowed: 2, 3]', function (done) {
lint.test(lint.file('shorthand-values.sass'), {
lint.test(file, {
'shorthand-values': [
1,
{
Expand All @@ -274,7 +278,7 @@ describe('shorthand values - sass', function () {
});

it('[allowed: 1, 2, 3] - as default', function (done) {
lint.test(lint.file('shorthand-values.sass'), {
lint.test(file, {
'shorthand-values': [
1,
{
Expand Down

0 comments on commit 25b29da

Please sign in to comment.