Skip to content

Commit

Permalink
getOpenSubtitlesLanguage with es_ES divhide#30
Browse files Browse the repository at this point in the history
* added test for .UTF-8 in the language string
  • Loading branch information
juanpabloaj committed Jun 27, 2016
1 parent e1fae8a commit 4b92158
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,5 @@ exports.getOpenSubtitlesLanguage = function(lang){
}
});

return languages[lang] || lang;
return languages[lang] || opensubLanguage || lang;
};
25 changes: 21 additions & 4 deletions lib/UtilsSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('indexSpec', function(){

});


it('.getOpenSubtitlesLanguage()', function(done){

var Utils = require('./Utils');
Expand All @@ -22,8 +22,25 @@ describe('indexSpec', function(){
expect(lang).to.be('pob');

done();

});


});
it('.getOpenSubtitlesLanguage() es_ES', function(done){

var Utils = require('./Utils');

var lang = Utils.getOpenSubtitlesLanguage('es_ES');
expect(lang).to.be('spa');

done();
});

it('.getOpenSubtitlesLanguage .UTF-8', function(done){
var Utils = require('./Utils');

var lang = Utils.getOpenSubtitlesLanguage('es_ES.UTF-8');
expect(lang).to.be('spa');

done();
});

});

0 comments on commit 4b92158

Please sign in to comment.