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?"