Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more verbose bonfire challenge descriptions #111

Closed
aldraco opened this issue Feb 21, 2015 · 3 comments
Closed

more verbose bonfire challenge descriptions #111

aldraco opened this issue Feb 21, 2015 · 3 comments

Comments

@aldraco
Copy link
Contributor

aldraco commented Feb 21, 2015

At times, the bonfire challenge descriptions do not always give a clear expectation of what the test cases are looking for. The test cases are sometimes visible when the programmer tries to run a program, but not always clearly written out from a user standpoint.

Example: "Where do I belong?"
"Return the lowest index at which a value (second argument) should be inserted into a sorted array (first argument)."
The test cases that are visible after submitting code are:
"assert.equal(indexForNum, 3, '35 should be inserted at index 3');"
assert.equal(indexFor30, 2, '30 should be inserted at index 2');

While the test cases obviously work from a functionality standpoint, what is visible to the user is not always clear. What are indexforNum and then indexfor30?

The description of the problem, visible upon load, could simply add,

"[[2,4,6,8], 7] should return 3"

If the lack of verbose instructions is part of the challenge, then it doesn't need changed; on the other hand, being a bit more explicit about the spec of a particular problem seems more "real-life" and could be helpful.

I am willing to add this feature myself, but only if it doesn't conflict with the intent and purpose of the bonfire challenges. :)

@brandenbyers
Copy link
Contributor

Good point on the invisible variables. @terakilobyte, could we print out variables declared in the tests? I didn't realize they wouldn't be visible.

Otherwise, yes, we can make the assertions obvious. There is no need for them to be in variables.

@terakilobyte
Copy link
Contributor

Looking at the json for this challenge revealed this.

"var numbers = [10, 20, 30, 40, 50], num = 35;",
"var indexForNum = where(numbers, num);",
"assert.equal(indexForNum, 3, '35 should be inserted at index 3');",
"var indexFor30 = where(numbers, 30);",
"assert.equal(indexFor30, 2, '30 should be inserted at index 2');"

If you mean print out the variables created as part of the test, no, there's no meaningful way to print those out separately. This bonfire needs to be rewritten to show the test case as part of the test, rather than whisking them away in a variable. I'll close this issue once I've done so.

@terakilobyte
Copy link
Contributor

The challenge has been updated to be more descriptive, and the tests have been rewritten to use expect instead of assert. A style guide would be greatly useful (wink wink to one of you) specifying that all bonfires should have additional information and no tests should use assert as they become quite long with the output text where as it's built into expect/should.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants