Add test for inreplace sub!/gsub! with hash argument

This commit is contained in:
Jack Nagel 2014-09-27 23:31:08 -05:00
parent 9f9f5bf31c
commit 14594741e1

View File

@ -87,4 +87,16 @@ class InreplaceTest < Homebrew::TestCase
s.gsub!("o", "e")
assert_equal "bee", s
end
def test_sub_gsub_with_hash
s = "foo"
s.extend(StringInreplaceExtension)
repl = { "f" => "b", "o" => "e" }
s.sub!(/[fo]/, repl)
assert_equal "boo", s
s.gsub!(/[fo]/, repl)
assert_equal "bee", s
end
end