summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Rakoczy & Matthew Horan <pair+arakoczy+mhoran@pivotallabs.com>2012-11-07 16:47:22 -0500
committerAlex Rakoczy & Matthew Horan <pair+arakoczy+mhoran@pivotallabs.com>2012-11-07 16:47:22 -0500
commit98ab8e98741b86f1e569997978186692fa7ce422 (patch)
tree9defec750ab1e89938ce0d0686931f7817d7aea6
parent518dc80ea5cfb94c79dfb316a781d6aea74ea79a (diff)
downloadrack-98ab8e98741b86f1e569997978186692fa7ce422.tar.gz
Make spec_sendfile work with Ruby < 1.9
-rw-r--r--test/spec_sendfile.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/test/spec_sendfile.rb b/test/spec_sendfile.rb
index 5c538aba..21a49e79 100644
--- a/test/spec_sendfile.rb
+++ b/test/spec_sendfile.rb
@@ -89,15 +89,11 @@ describe Rack::Sendfile do
dir1 = Dir.mktmpdir
dir2 = Dir.mktmpdir
- first_body = ['hello world']
- first_body.define_singleton_method(:to_path) do
- File.expand_path(FileUtils.touch(File.join(dir1, 'rack_sendfile')).first)
- end
+ first_body = File.open(File.join(dir1, 'rack_sendfile'), 'w+')
+ first_body.puts 'hello world'
- second_body = ['goodbye world']
- second_body.define_singleton_method(:to_path) do
- File.expand_path(FileUtils.touch(File.join(dir2, 'rack_sendfile')).first)
- end
+ second_body = File.open(File.join(dir2, 'rack_sendfile'), 'w+')
+ second_body.puts 'goodbye world'
mappings = {
"#{dir1}/" => '/foo/bar/',