Skip to content

Commit

Permalink
v0.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
tenorok committed Jun 19, 2015
2 parents cd07085 + d4755d3 commit e3096cf
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module.exports = function(grunt) {
},
jscs: { command: './node_modules/.bin/jscs modules/' },
jshint: { command: './node_modules/.bin/jshint modules/' },
yaspeller: { options: { stderr: false }, command: './node_modules/.bin/yaspeller --lang ru README.md' }
yaspeller: { options: { stderr: false }, command: './node_modules/.bin/yaspeller README.md' }
},
definer: Target.definer(),
mochaTest: Target.mocha(module),
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bemer",
"description": "Template engine. BEMJSON to HTML processor.",
"version": "0.8.1",
"version": "0.8.2",
"license": "MIT",
"ignore": [
"**/.*",
Expand Down
2 changes: 1 addition & 1 deletion modules/Match.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ definer('Match', /** @exports Match */ function(Selector, object, is) {
* @returns {boolean}
*/
_blockMod: function(mods) {
if(this._pattern.isBlock() && !this._pattern.modName() && !this._pattern.modVal()) {
if(!this._pattern.modName() && !this._pattern.modVal()) {
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bemer",
"description": "Template engine. BEMJSON to HTML processor.",
"version": "0.8.1",
"version": "0.8.2",
"repository": {
"type": "git",
"url": "https://github.com/tenorok/bemer.git"
Expand Down
17 changes: 16 additions & 1 deletion test/MatchTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,25 @@ definer('MatchTest', function(assert, Match) {
assert.isFalse(match.is({ block: 'block', elemMods: { mod: 'val' }}));
});

it('Элемент у блока с булевым модификатором', function() {
var match = new Match('block_mod__elem');
assert.isFalse(match.is({ block: 'block', elem: 'elem' }));
assert.isFalse(match.is({ block: 'block', mods: { mod: 'val' }, elem: 'elem' }));
assert.isTrue(match.is({ block: 'block', mods: { mod: true }, elem: 'elem' }));
});

it('Элемент у блока с модификатором', function() {
var match = new Match('block_mod_val__elem');
assert.isFalse(match.is({ block: 'block', elem: 'elem' }));
assert.isFalse(match.is({ block: 'block', mods: { mod: true }, elem: 'elem' }));
assert.isFalse(match.is({ block: 'block', mods: { mod: 'no' }, elem: 'elem' }));
assert.isTrue(match.is({ block: 'block', mods: { mod: 'val' }, elem: 'elem' }));
});

it('Элемент', function() {
var match = new Match('block__elem');
assert.isFalse(match.is({ block: 'block' }));
assert.isFalse(match.is({ block: 'block', mods: { size: 's' }, elem: 'elem' }));
assert.isTrue(match.is({ block: 'block', mods: { size: 's' }, elem: 'elem' }));
assert.isTrue(match.is({ block: 'block', mods: {}, elem: 'elem' }));
assert.isTrue(match.is({ block: 'block', mods: {}, elem: 'elem', elemMods: {}}));
});
Expand Down

0 comments on commit e3096cf

Please sign in to comment.