[7439987] Changed symbol inclusion test to use strings.

This commit is contained in:
Jim Weirich
2010-12-23 10:16:34 -05:00
parent 3dab146b8d
commit 297cfde6a3
2 changed files with 8 additions and 6 deletions

View File

@@ -24,13 +24,14 @@ class AboutSymbols < EdgeCase::Koan
end end
def test_method_names_become_symbols 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 end
# THINK ABOUT IT: # THINK ABOUT IT:
# #
# Why do we capture the list of symbols before we check for the # Why do we convert the list of symbols to strings and then compare
# method name? # against the string value rather than against symbols?
in_ruby_version("mri") do in_ruby_version("mri") do
RubyConstant = "What is the sound of one hand clapping?" RubyConstant = "What is the sound of one hand clapping?"

View File

@@ -24,13 +24,14 @@ class AboutSymbols < EdgeCase::Koan
end end
def test_method_names_become_symbols 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 end
# THINK ABOUT IT: # THINK ABOUT IT:
# #
# Why do we capture the list of symbols before we check for the # Why do we convert the list of symbols to strings and then compare
# method name? # against the string value rather than against symbols?
in_ruby_version("mri") do in_ruby_version("mri") do
RubyConstant = "What is the sound of one hand clapping?" RubyConstant = "What is the sound of one hand clapping?"