summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-02-04 17:48:34 -0800
committerEric Wong <normalperson@yhbt.net>2011-02-04 17:50:03 -0800
commitf015a843fcfa120286628ec75829575ee2391380 (patch)
tree3e53a3f08d65a92c34acc3778ffe2285d9fe7298 /t
parent82579a5f20531e69eb40e6a58a931b6c5f77d548 (diff)
ed can do in-place editing portably, unlike sed.
Diffstat (limited to 't')
-rwxr-xr-xt/t0014-config-conflict.sh8
-rwxr-xr-xt/t0104-rack-input-limit-tiny.sh10
-rwxr-xr-xt/t0105-rack-input-limit-bigger.sh10
-rwxr-xr-xt/t0107-rack-input-limit-zero.sh10
4 files changed, 23 insertions, 15 deletions
diff --git a/t/t0014-config-conflict.sh b/t/t0014-config-conflict.sh
index b06c915..088f218 100755
--- a/t/t0014-config-conflict.sh
+++ b/t/t0014-config-conflict.sh
@@ -4,7 +4,7 @@ t_plan 6 "config variables conflict with preload_app"
 
 t_begin "setup and start" && {
         rainbows_setup
-        rtmpfiles ru rutmp
+        rtmpfiles ru
 
         cat > $ru <<\EOF
 use Rack::ContentLength
@@ -23,8 +23,10 @@ t_begin "hit with curl" && {
 }
 
 t_begin "modify rackup file" && {
-        sed -e 's/world/WORLD/' < $ru > $rutmp
-        mv $rutmp $ru
+        ed -s $ru <<EOF
+,s/world/WORLD/
+w
+EOF
 }
 
 t_begin "reload signal succeeds" && {
diff --git a/t/t0104-rack-input-limit-tiny.sh b/t/t0104-rack-input-limit-tiny.sh
index 284d7c0..1104a97 100755
--- a/t/t0104-rack-input-limit-tiny.sh
+++ b/t/t0104-rack-input-limit-tiny.sh
@@ -6,11 +6,13 @@ req_curl_chunked_upload_err_check
 t_plan 18 "rack.input client_max_body_size tiny"
 
 t_begin "setup and startup" && {
-        rtmpfiles curl_out curl_err cmbs_config
+        rtmpfiles curl_out curl_err
         rainbows_setup $model
-        sed -e 's/client_max_body_size.*/client_max_body_size 256/' \
-          < $unicorn_config > $cmbs_config
-        rainbows -D sha1-random-size.ru -c $cmbs_config
+        ed -s $unicorn_config <<EOF
+,s/client_max_body_size.*/client_max_body_size 256/
+w
+EOF
+        rainbows -D sha1-random-size.ru -c $unicorn_config
         rainbows_wait_start
 }
 
diff --git a/t/t0105-rack-input-limit-bigger.sh b/t/t0105-rack-input-limit-bigger.sh
index 642dd2b..ed13d4e 100755
--- a/t/t0105-rack-input-limit-bigger.sh
+++ b/t/t0105-rack-input-limit-bigger.sh
@@ -6,11 +6,13 @@ req_curl_chunked_upload_err_check
 t_plan 10 "rack.input client_max_body_size bigger"
 
 t_begin "setup and startup" && {
-        rtmpfiles curl_out curl_err cmbs_config
+        rtmpfiles curl_out curl_err
         rainbows_setup $model
-        sed -e 's/client_max_body_size.*/client_max_body_size 10485760/' \
-          < $unicorn_config > $cmbs_config
-        rainbows -D sha1-random-size.ru -c $cmbs_config
+        ed -s $unicorn_config <<EOF
+,s/client_max_body_size.*/client_max_body_size 10485760/
+w
+EOF
+        rainbows -D sha1-random-size.ru -c $unicorn_config
         rainbows_wait_start
 }
 
diff --git a/t/t0107-rack-input-limit-zero.sh b/t/t0107-rack-input-limit-zero.sh
index eb947ba..94aa256 100755
--- a/t/t0107-rack-input-limit-zero.sh
+++ b/t/t0107-rack-input-limit-zero.sh
@@ -5,11 +5,13 @@ req_curl_chunked_upload_err_check
 t_plan 6 "rack.input client_max_body_size zero"
 
 t_begin "setup and startup" && {
-        rtmpfiles curl_out curl_err cmbs_config
+        rtmpfiles curl_out curl_err
         rainbows_setup $model
-        sed -e 's/client_max_body_size.*/client_max_body_size 0/' \
-          < $unicorn_config > $cmbs_config
-        rainbows -D sha1-random-size.ru -c $cmbs_config
+        ed -s $unicorn_config <<EOF
+,s/client_max_body_size.*/client_max_body_size 0/
+w
+EOF
+        rainbows -D sha1-random-size.ru -c $unicorn_config
         rainbows_wait_start
         empty_sha1=da39a3ee5e6b4b0d3255bfef95601890afd80709
 }