Every repository with this icon (
Every repository with this icon (
| Description: | A set of Koans to teach the Ruby language edit |
-
Doesn't work wirh ruby1.9.1 (at least not on winxp machine)
3 comments Created 3 months ago by HoornetWith the old Ruby everything works ok. Not so in 1.9.1.
My error report happened at first "rake" command:
ruby 1.9.1p129 (2009-05-12 revision 23412) [i386-mingw32]
F:\gitlocalrepo\LEARNING\ruby_koans_cloned>rake
(in F:/gitlocalrepo/LEARNING/ruby_koans_cloned) cd koans
C:/Ruby19/bin/ruby.exe path_to_enlightenment.rb
F:/gitlocalrepo/LEARNING/ruby_koans_cloned/koans/edgecase.rb:21:in `<class:Sense
i>': uninitialized constant Test::Unit::AssertionFailedError (NameError)
from F:/gitlocalrepo/LEARNING/ruby_koans_cloned/koans/edgecase.rb:18:in`<module:EdgeCase>'
from F:/gitlocalrepo/LEARNING/ruby_koans_cloned/koans/edgecase.rb:17:in`'
from F:/gitlocalrepo/LEARNING/ruby_koans_cloned/koans/about_basics.rb:4:in `require'
from F:/gitlocalrepo/LEARNING/ruby_koans_cloned/koans/about_basics.rb:4:in `'
from path_to_enlightenment.rb:3:in `require' from path_to_enlightenment.rb:3:in `<main>'rake aborted!
Command failed with status (1): [C:/Ruby19/bin/ruby.exe path_to_enlightenme...]
(See full trace by running task with --trace)Comments
-
Download dies waiting on google-analytics.com
0 comments Created 2 months ago by jevergunTrying to download Ruby Koans by clicking download button above. In IE8, it does nothing, and gives status message "Done, but with errors on page." In Firefox, it hangs forever while status bar says "Read www.google-analytics.com" Completely unable to download the file.
Comments
-
You have not yet reached enlightenment ... is not true.
2 comments Created 2 months ago by bretI just pulled yesterday's update. When i first type rake, my output includes the following:
You have not yet reached enlightenment ...
is not true.Is this intented? I seem to recall seeing something more prosaic beforehand.
Comments
Your console should should look like below. I'm pretty sure this is how it always was. There's more stuff in the README - is that what you're thinking of?
Thinking AboutAsserts
test_assert_truth has damaged your karma.You have not yet reached enlightenment ...
<false> is not true.Please meditate on the following code:
./about_basics.rb:10:in `test_assert_truth' path_to_enlightenment.rb:27 -
Maybe my mind is obfuscated, but I can't understand why triangle(2, 4, 2) should raise an error!
Please help me meditate on the following code:
./about_triangle_project_2.rb:12:in `test_illegal_triangles_throw_exceptions'It seem to me that triangle(2, 4, 2) should return :isosceles
Comments
-
using the
hash = { :one => "uno", :two => "dos" }the expression
hash.keys.sortgenerate a runtime error, because the symbols :one and :two aren't enumerable (regardless of anything replacing the )
My two cent solution:
hash = { "one" => "uno", "two" => "dos" }so the test became:
assert_equal ["one", "two"], hash.keys.sortHave I expanded my awareness ?
Comments
I agree... I ran into this problem while running through the koans before giving it to someone who is still learning. This could be very confusing. My solution was to reopen symbol in about_hashes.rb and do this:
class Symbol
include Comparabledef <=>(other)
self.to_s <=> other.to_send end
referenced from http://snippets.dzone.com/posts/show/7140
Another possible fix that I just did was to change the sort line to:
assert_equal __, hash.keys.sort_by {|s| s.to_s}
As someone who's using Koans to learn ruby it wasn't obvious how to fix the problem. It would be nice if Koans did that under the hood, but at the same time it might be nice to demonstrate that sort doesn't work on :symbols.
Surprisingly, doing that fix was the first time I actually understood the block stuff.
-
Its getting what it is expecting but it still says "No Good"
You have not yet reached enlightenment ...
<:peanut> expected but was
<[:peanut]>.Please meditate on the following code:
./about_arrays.rb:38:in `test_slicing_arrays' path_to_enlightenment.rb:27def test_slicing_arrays
array = [:peanut, :butter, :and, :jelly] assert_equal :peanut, array[0,1] assert_equal __, array[0,2] assert_equal __, array[2,2] assert_equal __, array[2,20] assert_equal __, array[4,0] assert_equal __, array[5,0]end
Comments
-
I thought this might be an interesting example to add to the parallel assignment koans
def test_parallel_assignment_with_two_variables first_name, last_name = ["Roy", "Rob"] first_name, last_name = last_name, first_name assert_equal 'Rob', first_name assert_equal 'Roy', last_name endComments












I can verify that this is the case on Ubuntu, as well. It looks like it's a matter of Test::Unit having been changed. I haven't looked into it for more than about 20 seconds so far. I'll see if I can figure it out and issue a pull request.
Ah. Badaboom:
That should do you for now. It's simply that test-unit is no longer in the Ruby standard library in 1.9.1 (maybe 1.9?), so you have to install the gem on it's own. Then the code works without modification.
Thanks, Ben! I was having the same problem. Which brings me to another question. Where will I find test-unit's rdocs? For some reason, test-unit doesn't appear on my localhost:8808 (gem server) page.