a zip code crypto-currency system good for red ONLY

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. var assert = require('assert'),
  2. path = require('path'),
  3. errors = require('../lib/errors');
  4. describe('binary errors', function() {
  5. function getCurrentPlatform() {
  6. if (process.platform === 'win32') {
  7. return 'Windows';
  8. } else if (process.platform === 'darwin') {
  9. return 'OS X';
  10. }
  11. return '';
  12. }
  13. function getCurrentArchitecture() {
  14. if (process.arch === 'x86' || process.arch === 'ia32') {
  15. return '32-bit';
  16. } else if (process.arch === 'x64') {
  17. return '64-bit';
  18. }
  19. return '';
  20. }
  21. function getCurrentEnvironment() {
  22. return getCurrentPlatform() + ' ' + getCurrentArchitecture();
  23. }
  24. describe('for an unsupported environment', function() {
  25. it('identifies the current environment', function() {
  26. var message = errors.unsupportedEnvironment();
  27. assert.ok(message.indexOf(getCurrentEnvironment()) !== -1);
  28. });
  29. it('links to supported environment documentation', function() {
  30. var message = errors.unsupportedEnvironment();
  31. assert.ok(message.indexOf('https://github.com/sass/node-sass/releases/tag/v') !== -1);
  32. });
  33. });
  34. describe('for an missing binary', function() {
  35. it('identifies the current environment', function() {
  36. var message = errors.missingBinary();
  37. assert.ok(message.indexOf(getCurrentEnvironment()) !== -1);
  38. });
  39. it('documents the expected binary location', function() {
  40. var message = errors.missingBinary();
  41. assert.ok(message.indexOf(path.sep + 'vendor' + path.sep) !== -1);
  42. });
  43. });
  44. });