[7439987] Changed symbol inclusion test to use strings.
authorJim Weirich <jim.weirich@gmail.com>
Thu, 23 Dec 2010 15:16:34 +0000 (10:16 -0500)
committerJim Weirich <jim.weirich@gmail.com>
Thu, 23 Dec 2010 15:16:34 +0000 (10:16 -0500)
koans/about_symbols.rb
src/about_symbols.rb

index 0c8a78b..2a7f4a3 100644 (file)
@@ -24,13 +24,14 @@ class AboutSymbols < EdgeCase::Koan
   end
 
   def test_method_names_become_symbols
-    assert_equal __, Symbol.all_symbols.include?("test_method_names_become_symbols".to_sym)
+    symbols_as_strings = Symbol.all_symbols.map { |x| x.to_s }
+    assert_equal __, symbols_as_strings.include?("test_method_names_become_symbols")
   end
 
   # THINK ABOUT IT:
   #
-  # Why do we capture the list of symbols before we check for the
-  # method name?
+  # Why do we convert the list of symbols to strings and then compare
+  # against the string value rather than against symbols?
 
   in_ruby_version("mri") do
     RubyConstant = "What is the sound of one hand clapping?"
index 0e05bdb..e06f5e1 100644 (file)
@@ -24,13 +24,14 @@ class AboutSymbols < EdgeCase::Koan
   end
 
   def test_method_names_become_symbols
-    assert_equal __(true), Symbol.all_symbols.include?("test_method_names_become_symbols".to_sym)
+    symbols_as_strings = Symbol.all_symbols.map { |x| x.to_s }
+    assert_equal __(true), symbols_as_strings.include?("test_method_names_become_symbols")
   end
 
   # THINK ABOUT IT:
   #
-  # Why do we capture the list of symbols before we check for the
-  # method name?
+  # Why do we convert the list of symbols to strings and then compare
+  # against the string value rather than against symbols?
 
   in_ruby_version("mri") do
     RubyConstant = "What is the sound of one hand clapping?"