Permalink
Browse files

Bypass some test which doesn't pass below node v0.9

  • Loading branch information...
1 parent 49d2acb commit 4af8de747ccdc4bb7d8126aed86371775e9dde30 @wdavidw wdavidw committed Feb 22, 2013
Showing with 10 additions and 4 deletions.
  1. +2 −1 package.json
  2. +8 −3 test/printf.coffee
View
@@ -25,7 +25,8 @@
"devDependencies": {
"coffee-script": "latest",
"should": "latest",
- "mocha": "latest"
+ "mocha": "latest",
+ "semver": "latest"
},
"repository": {
"type": "git",
View
@@ -1,4 +1,6 @@
-should = require "should"
+
+semver = require 'semver'
+should = require 'should'
printf = if process.env.PRINTF_COV then require '../lib-cov/printf' else require '../lib/printf'
describe 'sprintf', ->
@@ -195,7 +197,10 @@ describe 'sprintf', ->
isnot:
array: [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]
maybe: undefined
- printf("%O", test).replace(/\s+/g, ' ').should.eql "{ foo: { is: { bar: true, baz: false }, isnot: { array: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, [length]: 10 ] }, maybe: undefined } }"
printf("%.0O", test).replace(/\s+/g, ' ').should.eql "{ foo: [Object] }"
- printf("%.2O", test).replace(/\s+/g, ' ').should.eql "{ foo: { is: { bar: true, baz: false }, isnot: { array: [Object] }, maybe: undefined } }"
printf("%A", test.foo.isnot.array).should.eql "[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 ]"
+ # Object inspect serialize object in different order when showHidden is true
+ return if semver.lt process.version, 'v0.9.0'
+ printf("%O", test).replace(/\s+/g, ' ').should.eql "{ foo: { is: { bar: true, baz: false }, isnot: { array: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, [length]: 10 ] }, maybe: undefined } }"
+ printf("%.2O", test).replace(/\s+/g, ' ').should.eql "{ foo: { is: { bar: true, baz: false }, isnot: { array: [Object] }, maybe: undefined } }"
+

0 comments on commit 4af8de7

Please sign in to comment.