1 var assert = require('assert'),
2 path = require('path'),
3 errors = require('../lib/errors');
5 describe('binary errors', function() {
7 function getCurrentPlatform() {
8 if (process.platform === 'win32') {
10 } else if (process.platform === 'darwin') {
16 function getCurrentArchitecture() {
17 if (process.arch === 'x86' || process.arch === 'ia32') {
19 } else if (process.arch === 'x64') {
25 function getCurrentEnvironment() {
26 return getCurrentPlatform() + ' ' + getCurrentArchitecture();
29 describe('for an unsupported environment', function() {
30 it('identifies the current environment', function() {
31 var message = errors.unsupportedEnvironment();
32 assert.ok(message.indexOf(getCurrentEnvironment()) !== -1);
35 it('links to supported environment documentation', function() {
36 var message = errors.unsupportedEnvironment();
37 assert.ok(message.indexOf('https://github.com/sass/node-sass/releases/tag/v') !== -1);
41 describe('for an missing binary', function() {
42 it('identifies the current environment', function() {
43 var message = errors.missingBinary();
44 assert.ok(message.indexOf(getCurrentEnvironment()) !== -1);
47 it('documents the expected binary location', function() {
48 var message = errors.missingBinary();
49 assert.ok(message.indexOf(path.sep + 'vendor' + path.sep) !== -1);