Skip to content

Commit

Permalink
Split out word phrases tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnAlbin committed Mar 10, 2015
1 parent 0bdba92 commit 17a4be8
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 92 deletions.
84 changes: 84 additions & 0 deletions test/fixtures-styles/sections-order-word-phrases.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
// Word phrases order test
//
// Styleguide beta - delta

// Word phrases order test
//
// Styleguide beta - alpha

// Word phrases order test
//
// Styleguide beta - beta

// Word phrases order test
//
// Styleguide beta - epsilon

// Word phrases order test
//
// Styleguide beta - gamma

// Word phrases order test
//
// Styleguide beta

// Word phrases order test
//
// Styleguide beta - alpha - alpha


// Weighted word phrases order test
//
// Weight: 2
//
// Style guide: gamma - epsilon

// Weighted word phrases order test
//
// Style guide: gamma - alpha

// Weighted word phrases order test
//
// Weight: 0
//
// Style guide: gamma - beta

// Weighted word phrases order test
//
// Weight: 2
//
// Style guide: gamma - delta

// Weighted word phrases order test
//
// Weight: 1
//
// Style guide: gamma - gamma

// Weighted word phrases order test
//
// Style guide: gamma

// Weighted word phrases order test
//
// Weight: -10
//
// Style guide: gamma - alpha - alpha

// Weighted word phrases order test
//
// Weight: -100
//
// Style guide: gamma - alpha - beta

// Weighted word phrases order test
//
// Weight: -1000
//
// Style guide: gamma - alpha - gamma

// Weighted word phrases order test
//
// Weight: -10000
//
// Style guide: gamma - alpha - delta
86 changes: 0 additions & 86 deletions test/fixtures-styles/sections-order.less
Original file line number Diff line number Diff line change
Expand Up @@ -71,89 +71,3 @@
// Word keys match test
//
// Styleguide alpha-bet


// Word phrases order test
//
// Styleguide beta - delta

// Word phrases order test
//
// Styleguide beta - alpha

// Word phrases order test
//
// Styleguide beta - beta

// Word phrases order test
//
// Styleguide beta - epsilon

// Word phrases order test
//
// Styleguide beta - gamma

// Word phrases order test
//
// Styleguide beta

// Word phrases order test
//
// Styleguide beta - alpha - alpha


// Weighted word phrases order test
//
// Weight: 2
//
// Style guide: gamma - epsilon

// Weighted word phrases order test
//
// Style guide: gamma - alpha

// Weighted word phrases order test
//
// Weight: 0
//
// Style guide: gamma - beta

// Weighted word phrases order test
//
// Weight: 2
//
// Style guide: gamma - delta

// Weighted word phrases order test
//
// Weight: 1
//
// Style guide: gamma - gamma

// Weighted word phrases order test
//
// Style guide: gamma

// Weighted word phrases order test
//
// Weight: -10
//
// Style guide: gamma - alpha - alpha

// Weighted word phrases order test
//
// Weight: -100
//
// Style guide: gamma - alpha - beta

// Weighted word phrases order test
//
// Weight: -1000
//
// Style guide: gamma - alpha - gamma

// Weighted word phrases order test
//
// Weight: -10000
//
// Style guide: gamma - alpha - delta
2 changes: 1 addition & 1 deletion test/kss.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ suite('.traverse()', function() {
kss.traverse(styleDirectory, { mask: maskAll }, function(err, styleguide) {
assert.ok(styleguide.data);
assert.ok(Array.isArray(styleguide.data.files));
assert.equal(styleguide.data.files.length, 28);
assert.equal(styleguide.data.files.length, 29);
done();
});
});
Expand Down
10 changes: 5 additions & 5 deletions test/kss_styleguide.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ suite('KssStyleguide', function() {
assert.equal( sections[0].data.reference, 'alpha-bet' );
});

sectionQuery('"Word phrase" sections should be returned in order', 'beta.x', { mask: 'sections-order.less' }, function(styleguide, sections) {
sectionQuery('"Word phrase" sections should be returned in order', 'beta.x', { mask: 'sections-order-word-phrases.less' }, function(styleguide, sections) {
var i,
l = sections.length,
expectedOrder = ['beta - alpha', 'beta - beta', 'beta - delta', 'beta - epsilon', 'beta - gamma'];
Expand Down Expand Up @@ -259,7 +259,7 @@ suite('KssStyleguide', function() {
assert.equal(sections.length, 6);
});

sectionQuery('"Word phrase" sections should be returned in order', /beta - .*/, { mask: 'sections-order.less' }, function(styleguide, sections) {
sectionQuery('"Word phrase" sections should be returned in order', /beta - .*/, { mask: 'sections-order-word-phrases.less' }, function(styleguide, sections) {
var i,
l = sections.length,
expectedOrder = ['beta - alpha', 'beta - alpha - alpha', 'beta - beta', 'beta - delta', 'beta - epsilon', 'beta - gamma'];
Expand All @@ -269,7 +269,7 @@ suite('KssStyleguide', function() {
assert.equal(sections.length, 6);
});

sectionQuery('Weighted "word phrase" sections should be returned in order', /gamma - .*/, { mask: 'sections-order.less' }, function(styleguide, sections) {
sectionQuery('Weighted "word phrase" sections should be returned in order', /gamma - .*/, { mask: 'sections-order-word-phrases.less' }, function(styleguide, sections) {
var i,
l = sections.length,
expectedOrder = ['gamma - alpha', 'gamma - alpha - delta', 'gamma - alpha - gamma', 'gamma - alpha - beta', 'gamma - alpha - alpha', 'gamma - beta', 'gamma - gamma', 'gamma - delta', 'gamma - epsilon'];
Expand All @@ -279,10 +279,10 @@ suite('KssStyleguide', function() {
assert.equal(sections.length, 9);
});

sectionQuery('Autoincrement values for sections should be returned in order', /gamma - .*/, { mask: 'sections-order.less' }, function(styleguide, sections) {
sectionQuery('Autoincrement values for sections should be returned in order', /gamma - .*/, { mask: 'sections-order-word-phrases.less' }, function(styleguide, sections) {
var i,
l = sections.length,
expectedOrder = ['5.1', '5.1.1', '5.1.2', '5.1.3', '5.1.4', '5.2', '5.3', '5.4', '5.5'];
expectedOrder = ['2.1', '2.1.1', '2.1.2', '2.1.3', '2.1.4', '2.2', '2.3', '2.4', '2.5'];
for (i = 0; i < l; i += 1) {
assert.equal( sections[i].data.autoincrement, expectedOrder[i] );
}
Expand Down

0 comments on commit 17a4be8

Please sign in to comment.