mirror of
https://github.com/edgecase/ruby_koans.git
synced 2026-04-15 07:23:19 -04:00
[7439987] Changed symbol inclusion test to use strings.
This commit is contained in:
@@ -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?"
|
||||||
|
|||||||
@@ -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?"
|
||||||
|
|||||||
Reference in New Issue
Block a user