Skip to content
Closed

test #72

Changes from 2 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
122eeff
Fixed natural summing specs so that they are below 1000 rather than u…
Dec 28, 2011
7d392e3
Corrected typo "Please medit(i)ate on the following code:"
Dec 28, 2011
e3bb788
Merge pull request #13 from jfraser/patch-1
gregmalcolm Jan 2, 2012
656fd24
Merge pull request #14 from jfraser/patch-2
gregmalcolm Jan 2, 2012
431f0ec
Making function braces consistent
wyattdanger May 14, 2012
ff8f175
Merge pull request #15 from wyattdanger/master
mrdavidlaing May 14, 2012
ee4baf8
Made global variables local
sunesimonsen Jul 31, 2012
64317bd
Merge pull request #16 from sunesimonsen/patch-1
mrdavidlaing Jul 31, 2012
5ee5cc4
Obfuscate variable and function names to aid true understanding -- su…
ultrasaurus Dec 28, 2012
dc6daac
Merge pull request #17 from blazingcloud/master
Dec 28, 2012
60a9671
Update koans/AboutArrays.js
magopian Feb 15, 2013
dd71c36
Merge pull request #18 from magopian/patch-1
Feb 15, 2013
20fc218
Replaces tabs with 2 spaces and removes whitespace from specs
mraaroncruz Apr 12, 2013
6e9e0d1
Merge pull request #22 from pferdefleisch/remove-tabs-and-whitespace-…
mrdavidlaing Apr 12, 2013
27ad9ab
Removed troublesome function koan. Fixes #9. Fixes #10.
mraaroncruz Apr 12, 2013
b3e40cd
Small indentation fix
morty May 19, 2013
860dae7
Merge pull request #24 from morty/patch-1
mrdavidlaing May 20, 2013
44b1af3
Fix missing semicolon.
jonasac Nov 29, 2013
8300368
Merge pull request #26 from jonasac/patch-1
mraaroncruz Dec 3, 2013
bce7da3
corrected misspelling in "megalomaniac" instances
useffc Dec 18, 2013
f3cb0f6
Merge pull request #28 from useffc/master
gregmalcolm Dec 19, 2013
73d903b
updates the LICENSE to include a proper header, a range of years for …
choskim Mar 14, 2014
b8c7a03
fixes indentation for comments and a punctuation mistake.
choskim Mar 15, 2014
08832bd
removes extra quotation mark
choskim Mar 15, 2014
307bf10
updates all comments in aboutExpects.js to have one space (not two sp…
choskim Mar 15, 2014
bdf23a5
Merge pull request #29 from choskim/license
gregmalcolm Mar 16, 2014
5f83a47
Merge pull request #30 from choskim/aboutExpects
gregmalcolm Mar 16, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions koans/AboutFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,20 @@ describe("About Functions", function() {
});

it("should use lexical scoping to synthesise functions", function () {

function makeIncreaseByFunction(increaseByAmount) {
var increaseByFunction = function increaseBy(numberToIncrease) {
return numberToIncrease + increaseByAmount;

function makeMysteryFunction(makerValue)
{
var newFunction = function doMysteriousThing(param)
{
return makerValue + param;
};
return increaseByFunction;
return newFunction;
}
var increaseBy3 = makeIncreaseByFunction(3);
var increaseBy5 = makeIncreaseByFunction(5);
expect(increaseBy3(10) + increaseBy5(10)).toBe(FILL_ME_IN);

var mysteryFunction3 = makeMysteryFunction(3);
var mysteryFunction5 = makeMysteryFunction(5);

expect(mysteryFunction3(10) + mysteryFunction5(5)).toBe(FILL_ME_IN);
});

it("should allow extra function arguments", function () {
Expand Down