aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorJack Nagel2014-09-27 23:31:08 -0500
committerJack Nagel2014-09-27 23:31:08 -0500
commit58ed2374930bdda5f7fb7faffecd8cf324b9c62b (patch)
tree7d147b9544cf94a7453fc9c7aac0bea32650e1c8 /Library/Homebrew/test
parente9d602899d152137cc57d276843be4d4c83a949f (diff)
downloadhomebrew-58ed2374930bdda5f7fb7faffecd8cf324b9c62b.tar.bz2
Add test for inreplace sub!/gsub!
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/test_inreplace.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_inreplace.rb b/Library/Homebrew/test/test_inreplace.rb
index 0acdc9342..5b226eb8d 100644
--- a/Library/Homebrew/test/test_inreplace.rb
+++ b/Library/Homebrew/test/test_inreplace.rb
@@ -76,4 +76,15 @@ class InreplaceTest < Homebrew::TestCase
s.remove_make_var! "LDFLAGS"
assert_equal "CFLAGS=-O3\n", s
end
+
+ def test_sub_gsub
+ s = "foo"
+ s.extend(StringInreplaceExtension)
+
+ s.sub!("f", "b")
+ assert_equal "boo", s
+
+ s.gsub!("o", "e")
+ assert_equal "bee", s
+ end
end