15. Passed with Errors


#1

More of a suggestion than a questions about 7.15: Hashes

The instructions are to create a hash called "my_hash" and to give it at least one key-value pair. I forgot to add a comma after every key-value pair, which resulted in errors. However, since the first pair was technically acceptable, the module graded my code as correct and allowed me to proceed. I would think that if anything was wrong with the user's code, it would fail the module.

My code:

my_hash =
{
"One" => 1
"Two" => 2
"Three" => 3
}

Error returned:

(ruby):3: syntax error, unexpected tSTRING_BEG, expecting '}'
"Two" => 2
^
(ruby):3: syntax error, unexpected tASSOC, expecting $end
"Two" => 2
^


#2

Huh... as soon as I tried to replicate it, it wouldn't accept it.


#3

@rozard Is it still accepting it?

I'll file a report somewhere if its still accepting the error code :smiley:


#4

Nope! Looks like it's still not accepting it. Perhaps it was a one-time fluke, or someone caught it right away?


#5

No worries then, it can mess up sometimes :slightly_smiling:


#6

Computers