git://git.eng.unimelb.edu.au
/
ruby_koans.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
58565c8
)
tweak for a more enlightened Regexp koan
author
Michael de Silva
<michael@mwdesilva.com>
Thu, 8 Sep 2011 13:23:01 +0000
(16:23 +0300)
committer
Michael de Silva
<michael@mwdesilva.com>
Thu, 8 Sep 2011 13:23:01 +0000
(16:23 +0300)
koans/about_regular_expressions.rb
patch
|
blob
|
history
diff --git
a/koans/about_regular_expressions.rb
b/koans/about_regular_expressions.rb
index
8344911
..
790bea3
100644
(file)
--- a/
koans/about_regular_expressions.rb
+++ b/
koans/about_regular_expressions.rb
@@
-84,6
+84,8
@@
class AboutRegularExpressions < EdgeCase::Koan
def test_shortcut_character_classes_are_negated_with_capitals
assert_equal __, "the number is 42"[/\D+/]
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+/]
end