mirror of
https://github.com/edgecase/ruby_koans.git
synced 2026-04-21 01:03:20 -04:00
UPdated koans to match latest source.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
require 'edgecase'
|
||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
||||
|
||||
class AboutStrings < EdgeCase::Koan
|
||||
def test_double_quoted_strings_are_strings
|
||||
@@ -146,11 +146,20 @@ EOS
|
||||
# Surprised?
|
||||
end
|
||||
|
||||
def test_single_characters_are_represented_by_integers
|
||||
assert_equal __, ?a
|
||||
assert_equal __, ?a == 97
|
||||
in_ruby_version("1.8") do
|
||||
def test_in_ruby_1_8_single_characters_are_represented_by_integers
|
||||
assert_equal __, ?a
|
||||
assert_equal __, ?a == 97
|
||||
|
||||
assert_equal __, ?b == (?a + 1)
|
||||
assert_equal __, ?b == (?a + 1)
|
||||
end
|
||||
end
|
||||
|
||||
in_ruby_version("1.9") do
|
||||
def test_in_ruby_1_8_single_characters_are_represented_by_strings
|
||||
assert_equal __, ?a
|
||||
assert_equal __, ?a == 97
|
||||
end
|
||||
end
|
||||
|
||||
def test_strings_can_be_split
|
||||
@@ -166,7 +175,7 @@ EOS
|
||||
|
||||
# NOTE: Patterns are formed from Regular Expressions. Ruby has a
|
||||
# very powerful Regular Expression library. Unfortunately, time
|
||||
# does not permit us to explore it in detail in Ruby 101.
|
||||
# does not permit us to explore it in detail now.
|
||||
end
|
||||
|
||||
def test_strings_can_be_joined
|
||||
|
||||
Reference in New Issue
Block a user