Generic Codecademy's submission correctness tests in Ruby and Python
If you are planning to do some course in Ruby or Python in the Codecademy platform, which is awesome by the way, this tests may help. It was planned to accept any type of exercise, see the * HOW TO USE: # How to use below.
First you need to know which kind of exercise you gonna need.
- Variable defined?
- Method defined?
- Class defined?
- Method inside a class defined?
- Method return value assertation.
- More to come...
After decided which kind of code you want to test, you can set the variables in the code and it will do the rest. =D
I want to know if the class Code was defined, just call the classDefined? method with the Code as argument
classDefined?(Code)
You will get a true value if it was defined, and false if it wasn't.
The messages logs are in progress, sorry about that.
Please see http://www.codecademy.com/pt/docs/submission_tests for more info.
I'm learning Ruby, and I know the code could be more awesome and I also need some help with the port to a Python code, so if you wanna contribute, be my guess.