Skip to content

Commit

Permalink
adding more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Awdesh committed Jan 2, 2016
1 parent fdf5609 commit 784f86b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
@@ -1,5 +1,6 @@
# Caesar-s-Cipher [![Build Status](https://travis-ci.org/Awdesh/Caesar-s-Cipher.svg?branch=master)](https://travis-ci.org/Awdesh/Caesar-s-Cipher) [![Coverage Status](https://coveralls.io/repos/Awdesh/Caesar-s-Cipher/badge.svg?branch=master&service=github)](https://coveralls.io/github/Awdesh/Caesar-s-Cipher?branch=master)
==============================================================


Node module to encode string. A small library that encodes string by shifting characters in a string.

## Installation
Expand Down
2 changes: 1 addition & 1 deletion index.js
@@ -1,7 +1,7 @@
'use strict';

module.exports = function (encodedStr) {
// body...
encodedStr = encodedStr.toUpperCase();
var codeArr = encodedStr.split(""); // String to Array
var len = codeArr.length;
var decodedArr = []; // Your Result goes here
Expand Down
12 changes: 12 additions & 0 deletions test/test.js
Expand Up @@ -8,4 +8,16 @@ describe('#cipher', function () {
var result = cipher("FREE");
expect(result).to.equal('SERR');
});
it('should encode lowercase words', function() {
var result = cipher("free");
expect(result).to.equal('SERR');
});
it('should encode lowercase words', function() {
var result = cipher("SERR-PIZZA!");
expect(result).to.equal('FREE-CVMMN!');
});
it('should encode lowercase words', function() {
var result = cipher("free cvmmn!");
expect(result).to.equal('SERR PIZZA!');
});
});

0 comments on commit 784f86b

Please sign in to comment.