aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/test_inreplace.rb
diff options
context:
space:
mode:
authorJack Nagel2014-09-26 22:01:00 -0500
committerJack Nagel2014-09-26 22:01:00 -0500
commit99ae0eecb15d25555a2bb27d029dfe29eb968faf (patch)
tree030263838043e3b8a770d2ab7d1a4415c564c355 /Library/Homebrew/test/test_inreplace.rb
parent3dd97ea31b9755a257a6406525e968f2fd4c94b8 (diff)
downloadhomebrew-99ae0eecb15d25555a2bb27d029dfe29eb968faf.tar.bz2
Add missing test for inreplace with tabs
Diffstat (limited to 'Library/Homebrew/test/test_inreplace.rb')
-rw-r--r--Library/Homebrew/test/test_inreplace.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_inreplace.rb b/Library/Homebrew/test/test_inreplace.rb
index 69f9ca43a..0acdc9342 100644
--- a/Library/Homebrew/test/test_inreplace.rb
+++ b/Library/Homebrew/test/test_inreplace.rb
@@ -63,4 +63,17 @@ class InreplaceTest < Homebrew::TestCase
s.extend(StringInreplaceExtension)
assert_equal "-Wall -O2", s.get_make_var("CFLAGS")
end
+
+ def test_change_make_var_with_tabs
+ s = "CFLAGS\t=\t-Wall -O2\nLDFLAGS\t=\t-lcrypto -lssl"
+ s.extend(StringInreplaceExtension)
+
+ assert_equal "-Wall -O2", s.get_make_var("CFLAGS")
+
+ s.change_make_var! "CFLAGS", "-O3"
+ assert_equal "CFLAGS=-O3\nLDFLAGS\t=\t-lcrypto -lssl", s
+
+ s.remove_make_var! "LDFLAGS"
+ assert_equal "CFLAGS=-O3\n", s
+ end
end