Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

simple spec refactoring

  • Loading branch information...
commit 0e5d850553856d2f31008795e890f6e0b16f2a67 1 parent d9705fc
Guillaume Denis authored
Showing with 24 additions and 28 deletions.
  1. +0 −28 test/constants.js
  2. +24 −0 test/greetings-test.js
View
28 test/constants.js
@@ -1,28 +0,0 @@
-var vows = require('vows')
- , assert = require('assert')
- , i18n = require('../index')({ dir: './test/fixtures'}).load()
-
-vows.describe('Translate constants').addBatch({
- 'when greeting someone': {
- topic: 'greeting',
-
- 'in English, we say Hello': function(topic) {
- assert.equal(i18n.setLocale('en').t(topic), 'Hello')
- },
-
- 'in French, we say Bonjour': function(topic) {
- assert.equal(i18n.setLocale('fr').t(topic), 'Bonjour')
- }
- },
- 'when greeting someone in the evening': {
- topic: 'evening.greeting',
-
- 'in English, we say Good evening': function(topic) {
- assert.equal(i18n.setLocale('en').t(topic), 'Good evening')
- },
-
- 'in French, we say Bonsoir': function(topic) {
- assert.equal(i18n.setLocale('fr').t(topic), 'Bonsoir')
- }
- }
-}).export(module)
View
24 test/greetings-test.js
@@ -0,0 +1,24 @@
+var vows = require('vows')
+ , assert = require('assert')
+ , i18n = require('../index')({ dir: './test/fixtures'}).load()
+
+vows.describe('Greetings').addBatch({
+ 'when greeting someone': {
+ topic: 'greeting',
+ 'in English, we say Hello': function(topic) {
+ assert.equal(i18n.setLocale('en').t(topic), 'Hello')
+ },
+ 'in French, we say Bonjour': function(topic) {
+ assert.equal(i18n.setLocale('fr').t(topic), 'Bonjour')
+ },
+ 'in the evening': {
+ topic: function(sayWhat) { return 'evening.' + sayWhat },
+ 'in English, we say Good evening': function(topic) {
+ assert.equal(i18n.setLocale('en').t(topic), 'Good evening')
+ },
+ 'in French, we say Bonsoir': function(topic) {
+ assert.equal(i18n.setLocale('fr').t(topic), 'Bonsoir')
+ }
+ }
+ }
+}).export(module)
Please sign in to comment.
Something went wrong with that request. Please try again.