From 297cfde6a31b58a8c3272e36fc2dbac0b2eb5ab7 Mon Sep 17 00:00:00 2001 From: Jim Weirich Date: Thu, 23 Dec 2010 10:16:34 -0500 Subject: [PATCH] [7439987] Changed symbol inclusion test to use strings. --- koans/about_symbols.rb | 7 ++++--- src/about_symbols.rb | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/koans/about_symbols.rb b/koans/about_symbols.rb index 0c8a78b..2a7f4a3 100644 --- a/koans/about_symbols.rb +++ b/koans/about_symbols.rb @@ -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?" diff --git a/src/about_symbols.rb b/src/about_symbols.rb index 0e05bdb..e06f5e1 100644 --- a/src/about_symbols.rb +++ b/src/about_symbols.rb @@ -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?"