From 4ac1a8df01556eb1b06562c280970650484996d1 Mon Sep 17 00:00:00 2001 From: Cody Loyd Date: Thu, 1 Mar 2018 13:14:00 -0600 Subject: [PATCH] remove simonsays --- simon_says/README.md | 15 ------- simon_says/simonSays.js | 37 ----------------- simon_says/simonSays.spec.js | 78 ------------------------------------ 3 files changed, 130 deletions(-) delete mode 100644 simon_says/README.md delete mode 100644 simon_says/simonSays.js delete mode 100644 simon_says/simonSays.spec.js diff --git a/simon_says/README.md b/simon_says/README.md deleted file mode 100644 index 5ea295d..0000000 --- a/simon_says/README.md +++ /dev/null @@ -1,15 +0,0 @@ -This exercise is meant to (loosely) simulate the game Simon Says. The goal of this program in order is: - -Echo the value given, - -Capitalize the value given, - -Repeat the value given, - -Return a piece of the value given, - -Return the first word of the value given, - -Create a title with the value given - -See Jasmine test cases for expected results. \ No newline at end of file diff --git a/simon_says/simonSays.js b/simon_says/simonSays.js deleted file mode 100644 index bab089f..0000000 --- a/simon_says/simonSays.js +++ /dev/null @@ -1,37 +0,0 @@ -function echo() { - -} - -function shout() { - -} - -function repeat() { - -} - -function pieceOfWord() { - -} - -function firstWord() { - -} - -function capitalize(word) { - return word.charAt(0).toUpperCase() + word.slice(1); - // This function just capitalizes the word given to it, use in conjunction with titleCreator -} - -function titleCreator() { - -} - -module.exports = { - echo, - shout, - repeat, - pieceOfWord, - firstWord, - titleCreator -} \ No newline at end of file diff --git a/simon_says/simonSays.spec.js b/simon_says/simonSays.spec.js deleted file mode 100644 index ae8f74c..0000000 --- a/simon_says/simonSays.spec.js +++ /dev/null @@ -1,78 +0,0 @@ -var simon = require ('./simonSays.js'); - -describe('Simon says', function() { - describe('echo', function() { - it('should echo hello', function() { - expect(simon.echo("hello")).toEqual("hello"); - }); - - it('should echo bye', function() { - expect(simon.echo("bye")).toEqual("bye") - }); - }); - - describe('shout', function() { - it('should shout hello', function() { - expect(simon.shout("hello")).toEqual("HELLO"); - }); - - it('should shout multiple words', function() { - expect(simon.shout("hello world")).toEqual("HELLO WORLD"); - }); - }); - - describe('repeat', function() { - it('should repeat', function() { - expect(simon.repeat("hello")).toEqual("hello hello"); - }); - - it('should repeat a number of times', function() { - expect(simon.repeat("hello",3)).toEqual("hello hello hello"); - }); - }); - - describe('pieceOfWord', function() { - it('returns the first letter', function() { - expect(simon.pieceOfWord("hello", 1)).toEqual("h"); - }); - - it('returns the first two letters', function() { - expect(simon.pieceOfWord("Bob", 2)).toEqual("Bo"); - }); - - it('returns the first several letters', function() { - var s = "abcdefg"; - expect(simon.pieceOfWord(s, 1)).toEqual("a"); - expect(simon.pieceOfWord(s, 2)).toEqual("ab"); - expect(simon.pieceOfWord(s, 3)).toEqual("abc"); - }); - }); - - describe('firstWord', function() { - it('tells us the first word of "Hello World" is "Hello"', function() { - expect(simon.firstWord("Hello World")).toEqual("Hello"); - }); - - it('tells us the first word of "oh dear" is "oh"', function() { - expect(simon.firstWord("oh dear")).toEqual("oh"); - }); - }); - - describe('titleCreator', function() { - it('capitalizes a word', function() { - expect(simon.titleCreator("jaws")).toEqual("Jaws"); - }); - - it('capitalizes every word (aka title case)', function() { - expect(simon.titleCreator("david copperfield")).toEqual("David Copperfield"); - }); - - it("doesn't capitalize 'little words' in a title", function() { - expect(simon.titleCreator("war and peace")).toEqual("War and Peace"); - }); - - it('does capitalize "little words" at the start of a title', function() { - expect(simon.titleCreator("the bridge over the river kwai")).toEqual("The Bridge over the River Kwai"); - }); - }); -}); \ No newline at end of file