mirror of
https://github.com/edgecase/ruby_koans.git
synced 2026-04-15 07:23:19 -04:00
tweak for a more enlightened Regexp koan
This commit is contained in:
@@ -84,6 +84,8 @@ class AboutRegularExpressions < EdgeCase::Koan
|
|||||||
def test_shortcut_character_classes_are_negated_with_capitals
|
def test_shortcut_character_classes_are_negated_with_capitals
|
||||||
assert_equal __, "the number is 42"[/\D+/]
|
assert_equal __, "the number is 42"[/\D+/]
|
||||||
assert_equal __, "space: \t\n"[/\S+/]
|
assert_equal __, "space: \t\n"[/\S+/]
|
||||||
|
# ... a programmer would most likely do
|
||||||
|
assert_equal __, "variable_1 = 42"[/[^a-zA-Z0-9_]+/]
|
||||||
assert_equal __, "variable_1 = 42"[/\W+/]
|
assert_equal __, "variable_1 = 42"[/\W+/]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user