From a0427b3e1880c68b0f84569b668f6cd683de8c45 Mon Sep 17 00:00:00 2001 From: Nathan Leniz Date: Fri, 13 Feb 2015 12:14:12 -0500 Subject: [PATCH 1/5] Fix for bonfire to allow people to prototype objects properly but lose default insertion point injection (i.e. they will get an error if they forget to call their function --- ...fireFramework_v0.1.0.js => bonfireFramework_v0.1.1.js} | 2 +- seed_data/bonfires.json | 8 ++++---- views/bonfire/bonfire.jade | 2 +- views/bonfire/show.jade | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) rename public/js/lib/bonfire/{bonfireFramework_v0.1.0.js => bonfireFramework_v0.1.1.js} (99%) diff --git a/public/js/lib/bonfire/bonfireFramework_v0.1.0.js b/public/js/lib/bonfire/bonfireFramework_v0.1.1.js similarity index 99% rename from public/js/lib/bonfire/bonfireFramework_v0.1.0.js rename to public/js/lib/bonfire/bonfireFramework_v0.1.1.js index c7487d3f30..03d531a5a0 100644 --- a/public/js/lib/bonfire/bonfireFramework_v0.1.0.js +++ b/public/js/lib/bonfire/bonfireFramework_v0.1.1.js @@ -122,7 +122,7 @@ function bonfireExecute() { userJavaScript = scrapeTests(userJavaScript); // simple fix in case the user forgets to invoke their function if (challengeEntryPoint && challengeSeed) { - userJavaScript = challengeEntryPoint + ' ' + userJavaScript; + //userJavaScript = challengeEntryPoint + ' ' + userJavaScript; } submit(userJavaScript, function(cls, message) { if (cls) { diff --git a/seed_data/bonfires.json b/seed_data/bonfires.json index 52a74e78d9..c17e62ea9c 100644 --- a/seed_data/bonfires.json +++ b/seed_data/bonfires.json @@ -506,10 +506,9 @@ "description": [ "Fill in the object constructor with the methods specified in the tests.", "Those methods are getFirstName(), getLastName(), getFullName(), setFirstName(), setLastName(), and setFullName().", - "These methods must be the only available means for interacting with the object.", - "There will be some linting errors on the tests. You may safely ignore them. You should see undefined in the console output." + "These methods must be the only available means for interacting with the object." ], - "challengeEntryPoint": "var bob = new Person('Bob Ross');", + "challengeEntryPoint": "var bob = new Person('Bob Ross');\nbob.getFullName();", "challengeSeed": "var Person = function(firstAndLast) {\n return firstAndLast;\r\n};", "tests": [ "expect(Object.keys(bob).length).to.eql(6);", @@ -524,7 +523,8 @@ "bob.setLastName('Trees');", "expect(bob.getLastName()).to.eql('Trees');", "bob.setFullName('George Carlin');", - "expect(bob.getFullName()).to.eql('George Carlin');" + "expect(bob.getFullName()).to.eql('George Carlin');", + "bob.setFullName('Bob Ross');" ] }, { diff --git a/views/bonfire/bonfire.jade b/views/bonfire/bonfire.jade index ca22dc3005..87399bac70 100644 --- a/views/bonfire/bonfire.jade +++ b/views/bonfire/bonfire.jade @@ -42,4 +42,4 @@ block content br ul#testSuite.list-group br - script(src='/js/lib/bonfire/bonfireFramework_v0.1.0.js') \ No newline at end of file + script(src='/js/lib/bonfire/bonfireFramework_v0.1.1.js') \ No newline at end of file diff --git a/views/bonfire/show.jade b/views/bonfire/show.jade index 7604a60262..d92ec50300 100644 --- a/views/bonfire/show.jade +++ b/views/bonfire/show.jade @@ -96,7 +96,7 @@ block content form.code .form-group.codeMirrorView textarea#codeEditor(autofocus=true) - script(src='/js/lib/bonfire/bonfireFramework_v0.1.0.js') + script(src='/js/lib/bonfire/bonfireFramework_v0.1.1.js') From 01cddba50dd4d56014e85b421d4bab11a0ad2bde Mon Sep 17 00:00:00 2001 From: Nathan Leniz Date: Fri, 13 Feb 2015 15:05:53 -0500 Subject: [PATCH 2/5] Fixed "truncate a string" test that was preventing users from completing the challenge --- seed_data/bonfires.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/seed_data/bonfires.json b/seed_data/bonfires.json index c17e62ea9c..54499a83e3 100644 --- a/seed_data/bonfires.json +++ b/seed_data/bonfires.json @@ -168,8 +168,7 @@ ], "challengeEntryPoint":"truncate('A-tisket a-tasket A green and yellow basket', 11);", "challengeSeed":"function truncate(str, num) {\n // Clear out that junk in your trunc\r\n return str;\r\n}", - "tests":[ - "var string = 'A-tisket a-tasket A green and yellow basket’;", + "tests": [ "assert.strictEqual(truncate('A-tisket a-tasket A green and yellow basket’, 24), 'A-tisket…’, ’should truncate string the given length');", "assert.strictEqual(truncate('A-tisket a-tasket A green and yellow basket’, 'A-tisket a-tasket A green and yellow basket’.length), string, 'should not truncate if string is = length');", "assert.strictEqual(truncate('A-tisket a-tasket A green and yellow basket’, 'A-tisket a-tasket A green and yellow basket’.length + 2), string, 'should not truncate if string is < length');" From 3bcf3d8d5448342ee77ff54efcd5b26ad19c6008 Mon Sep 17 00:00:00 2001 From: Nathan Leniz Date: Fri, 13 Feb 2015 15:46:28 -0500 Subject: [PATCH 3/5] More fixes for truncate --- seed_data/bonfires.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/seed_data/bonfires.json b/seed_data/bonfires.json index 54499a83e3..a3d1ef2767 100644 --- a/seed_data/bonfires.json +++ b/seed_data/bonfires.json @@ -167,11 +167,11 @@ "Note that the three dots at the end add to the string length." ], "challengeEntryPoint":"truncate('A-tisket a-tasket A green and yellow basket', 11);", - "challengeSeed":"function truncate(str, num) {\n // Clear out that junk in your trunc\r\n return str;\r\n}", + "challengeSeed":"function truncate(str, num) {\n // Clear out that junk in your trunk\r\n return str;\r\n}", "tests": [ - "assert.strictEqual(truncate('A-tisket a-tasket A green and yellow basket’, 24), 'A-tisket…’, ’should truncate string the given length');", - "assert.strictEqual(truncate('A-tisket a-tasket A green and yellow basket’, 'A-tisket a-tasket A green and yellow basket’.length), string, 'should not truncate if string is = length');", - "assert.strictEqual(truncate('A-tisket a-tasket A green and yellow basket’, 'A-tisket a-tasket A green and yellow basket’.length + 2), string, 'should not truncate if string is < length');" + "expect(truncate('A-tisket a-tasket A green and yellow basket', 24)).to.eqls('A-tisket…');", + "assert(truncate('A-tisket a-tasket A green and yellow basket', 'A-tisket a-tasket A green and yellow basket'.length) === 'A-tisket a-tasket A green and yellow basket', 'should not truncate if string is = length');", + "assert.strictEqual(truncate('A-tisket a-tasket A green and yellow basket', 'A-tisket a-tasket A green and yellow basket'.length + 2), 'A-tisket a-tasket A green and yellow basket', 'should not truncate if string is < length');" ] }, { From cfec52c15bd1f005203ab8077727b05c98b66403 Mon Sep 17 00:00:00 2001 From: Nathan Leniz Date: Fri, 13 Feb 2015 15:53:29 -0500 Subject: [PATCH 4/5] Even more cleanup of truncate challenge --- seed_data/bonfires.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed_data/bonfires.json b/seed_data/bonfires.json index a3d1ef2767..6d507f6563 100644 --- a/seed_data/bonfires.json +++ b/seed_data/bonfires.json @@ -169,7 +169,7 @@ "challengeEntryPoint":"truncate('A-tisket a-tasket A green and yellow basket', 11);", "challengeSeed":"function truncate(str, num) {\n // Clear out that junk in your trunk\r\n return str;\r\n}", "tests": [ - "expect(truncate('A-tisket a-tasket A green and yellow basket', 24)).to.eqls('A-tisket…');", + "expect(truncate('A-tisket a-tasket A green and yellow basket', 11)).to.eqls('A-tisket…');", "assert(truncate('A-tisket a-tasket A green and yellow basket', 'A-tisket a-tasket A green and yellow basket'.length) === 'A-tisket a-tasket A green and yellow basket', 'should not truncate if string is = length');", "assert.strictEqual(truncate('A-tisket a-tasket A green and yellow basket', 'A-tisket a-tasket A green and yellow basket'.length + 2), 'A-tisket a-tasket A green and yellow basket', 'should not truncate if string is < length');" ] From 54901a4b9b9d84c6764b1b3b162efc44bd3c5b72 Mon Sep 17 00:00:00 2001 From: Nathan Leniz Date: Fri, 13 Feb 2015 15:55:18 -0500 Subject: [PATCH 5/5] Remove special characters inserted from somewhere that were throwing off truncate challenges --- seed_data/bonfires.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed_data/bonfires.json b/seed_data/bonfires.json index 6d507f6563..b41aaffca7 100644 --- a/seed_data/bonfires.json +++ b/seed_data/bonfires.json @@ -169,7 +169,7 @@ "challengeEntryPoint":"truncate('A-tisket a-tasket A green and yellow basket', 11);", "challengeSeed":"function truncate(str, num) {\n // Clear out that junk in your trunk\r\n return str;\r\n}", "tests": [ - "expect(truncate('A-tisket a-tasket A green and yellow basket', 11)).to.eqls('A-tisket…');", + "expect(truncate('A-tisket a-tasket A green and yellow basket', 11)).to.eqls('A-tisket...');", "assert(truncate('A-tisket a-tasket A green and yellow basket', 'A-tisket a-tasket A green and yellow basket'.length) === 'A-tisket a-tasket A green and yellow basket', 'should not truncate if string is = length');", "assert.strictEqual(truncate('A-tisket a-tasket A green and yellow basket', 'A-tisket a-tasket A green and yellow basket'.length + 2), 'A-tisket a-tasket A green and yellow basket', 'should not truncate if string is < length');" ]