Handle version 2.1

This commit is contained in:
Jim Weirich
2014-01-13 15:07:30 -05:00
parent c57b275de8
commit ad08a8de35

View File

@@ -3,10 +3,10 @@ require File.expand_path(File.dirname(__FILE__) + '/neo')
class AboutIteration < Neo::Koan
# -- An Aside ------------------------------------------------------
# Ruby 1.8 stores names as strings. Ruby 1.9 stores names as
# symbols. So we use a version dependent method "as_name" to convert
# to the right format in the koans. We will use "as_name" whenever
# comparing to lists of methods.
# Ruby 1.8 stores names as strings. Ruby 1.9 and later stores names
# as symbols. So we use a version dependent method "as_name" to
# convert to the right format in the koans. We will use "as_name"
# whenever comparing to lists of methods.
in_ruby_version("1.8") do
def as_name(name)
@@ -14,7 +14,7 @@ class AboutIteration < Neo::Koan
end
end
in_ruby_version("1.9", "2.0") do
in_ruby_version("1.9", "2") do
def as_name(name)
name.to_sym
end