Skip to content

Commit

Permalink
Remove unnecessary slashes in path.join statements
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrimue committed May 24, 2016
1 parent c43d875 commit b5ef62d
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions test/y18n-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('y18n', function () {
expect(function () {
var __ = y18n({
locale: 'bad-locale',
directory: path.join(__dirname, '/locales')
directory: path.join(__dirname, 'locales')
}).__

__('Hello')
Expand All @@ -32,7 +32,7 @@ describe('y18n', function () {
describe('__', function () {
it('uses replacements from the default locale if none is configured', function () {
var __ = y18n({
directory: path.join(__dirname, '/locales')
directory: path.join(__dirname, 'locales')
}).__

__('Hello').should.equal('Hello!')
Expand All @@ -41,7 +41,7 @@ describe('y18n', function () {
it('uses replacements from the configured locale', function () {
var __ = y18n({
locale: 'pirate',
directory: path.join(__dirname, '/locales')
directory: path.join(__dirname, 'locales')
}).__

__('Hello').should.equal('Avast ye mateys!')
Expand All @@ -50,7 +50,7 @@ describe('y18n', function () {
it('uses language file if language_territory file does not exist', function () {
var __ = y18n({
locale: 'pirate_JM',
directory: path.join(__dirname, '/locales')
directory: path.join(__dirname, 'locales')
}).__

__('Hello').should.equal('Avast ye mateys!')
Expand All @@ -61,7 +61,7 @@ describe('y18n', function () {
locale: 'pirate_JM',
fallbackToLanguage: false,
updateFiles: false,
directory: path.join(__dirname, '/locales')
directory: path.join(__dirname, 'locales')
}).__

__('Hello').should.equal('Hello')
Expand All @@ -71,15 +71,15 @@ describe('y18n', function () {
var __ = y18n({
locale: 'zz_ZZ',
updateFiles: false,
directory: path.join(__dirname, '/locales')
directory: path.join(__dirname, 'locales')
}).__

__('Hello').should.equal('Hello')
})

it('expands arguments into %s placeholders', function () {
var __ = y18n({
directory: path.join(__dirname, '/locales')
directory: path.join(__dirname, 'locales')
}).__

__('Hello %s %s', 'Ben', 'Coe').should.equal('Hello Ben Coe')
Expand All @@ -95,7 +95,7 @@ describe('y18n', function () {
it('returns the word immediately', function () {
var __ = y18n({
locale: 'fr',
directory: path.join(__dirname, '/locales')
directory: path.join(__dirname, 'locales')
}).__

__('banana').should.equal('banana')
Expand All @@ -104,7 +104,7 @@ describe('y18n', function () {
it('writes new word to locale file if updateFiles is true', function (done) {
var __ = y18n({
locale: 'fr_FR',
directory: path.join(__dirname, '/locales')
directory: path.join(__dirname, 'locales')
}).__

__('banana', function (err) {
Expand All @@ -119,7 +119,7 @@ describe('y18n', function () {

var __ = y18n({
locale: 'fr_FR',
directory: path.join(__dirname, '/locales')
directory: path.join(__dirname, 'locales')
}).__

__('meow').should.equal('le meow')
Expand All @@ -136,7 +136,7 @@ describe('y18n', function () {
var __ = y18n({
locale: 'fr_FR',
fallbackToLanguage: false,
directory: path.join(__dirname, '/locales')
directory: path.join(__dirname, 'locales')
}).__

__('banana', function (err) {
Expand All @@ -157,7 +157,7 @@ describe('y18n', function () {
it('handles enqueuing multiple writes at the same time', function (done) {
var __ = y18n({
locale: 'fr',
directory: path.join(__dirname, '/locales')
directory: path.join(__dirname, 'locales')
}).__

__('apple')
Expand All @@ -178,7 +178,7 @@ describe('y18n', function () {
var __ = y18n({
locale: 'fr',
updateFiles: false,
directory: path.join(__dirname, '/locales')
directory: path.join(__dirname, 'locales')
}).__

__('banana', function (err) {
Expand All @@ -192,23 +192,23 @@ describe('y18n', function () {
describe('__n', function () {
it('uses the singular form if quantity is 1', function () {
var __n = y18n({
directory: path.join(__dirname, '/locales')
directory: path.join(__dirname, 'locales')
}).__n

__n('%d cat', '%d cats', 1).should.equal('1 cat')
})

it('uses the plural form if quantity is greater than 1', function () {
var __n = y18n({
directory: path.join(__dirname, '/locales')
directory: path.join(__dirname, 'locales')
}).__n

__n('%d cat', '%d cats', 2).should.equal('2 cats')
})

it('allows additional arguments to be printed', function () {
var __n = y18n({
directory: path.join(__dirname, '/locales')
directory: path.join(__dirname, 'locales')
}).__n

__n('%d %s cat', '%d %s cats', 2, 'black').should.equal('2 black cats')
Expand All @@ -217,7 +217,7 @@ describe('y18n', function () {
it('allows an alternative locale to be set', function () {
var __n = y18n({
locale: 'pirate',
directory: path.join(__dirname, '/locales')
directory: path.join(__dirname, 'locales')
}).__n

__n('%d cat', '%d cats', 1).should.equal('1 land catfish')
Expand All @@ -227,7 +227,7 @@ describe('y18n', function () {
// See: https://github.com/bcoe/yargs/pull/210
it('allows a quantity placeholder to be provided in the plural but not singular form', function () {
var __n = y18n({
directory: path.join(__dirname, '/locales')
directory: path.join(__dirname, 'locales')
}).__n

var singular = __n('There is one monkey in the %s', 'There are %d monkeys in the %s', 1, 'tree')
Expand All @@ -247,7 +247,7 @@ describe('y18n', function () {
it('returns the pluralization immediately', function () {
var __n = y18n({
locale: 'fr',
directory: path.join(__dirname, '/locales')
directory: path.join(__dirname, 'locales')
}).__n

__n('%d le cat', '%d le cats', 1).should.equal('1 le cat')
Expand All @@ -256,7 +256,7 @@ describe('y18n', function () {
it('writes to the locale file if updateFiles is true', function (done) {
var __n = y18n({
locale: 'fr',
directory: path.join(__dirname, '/locales')
directory: path.join(__dirname, 'locales')
}).__n

__n('%d apple %s', '%d apples %s', 2, 'dude', function (err) {
Expand All @@ -271,7 +271,7 @@ describe('y18n', function () {
var __n = y18n({
locale: 'fr',
updateFiles: false,
directory: path.join(__dirname, '/locales')
directory: path.join(__dirname, 'locales')
}).__n

__n('%d apple %s', '%d apples %s', 2, 'dude', function (err) {
Expand All @@ -285,7 +285,7 @@ describe('y18n', function () {
describe('setLocale', function () {
it('switches the locale', function () {
var i18n = y18n({
directory: path.join(__dirname, '/locales')
directory: path.join(__dirname, 'locales')
})

i18n.__('Hello').should.equal('Hello!')
Expand All @@ -304,7 +304,7 @@ describe('y18n', function () {
it('updates the locale with the new lookups provided', function () {
var i18n = y18n({
locale: 'fr',
directory: path.join(__dirname, '/locales')
directory: path.join(__dirname, 'locales')
})

i18n.updateLocale({
Expand All @@ -319,7 +319,7 @@ describe('y18n', function () {

var i18n = y18n({
locale: 'fr',
directory: path.join(__dirname, '/locales')
directory: path.join(__dirname, 'locales')
})

i18n.updateLocale({
Expand Down

0 comments on commit b5ef62d

Please sign in to comment.