Skip to content

Instantly share code, notes, and snippets.

/ruby.rb Secret

Created May 28, 2015 17:05
Show Gist options
  • Save anonymous/d9684554dd9cdedc46ab to your computer and use it in GitHub Desktop.
Save anonymous/d9684554dd9cdedc46ab to your computer and use it in GitHub Desktop.
def test_sub_is_like_find_and_replace
assert_equal __, "one two-three".sub(/(t\w*)/) { $1[0, 1] }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment