From ccd1c435ee646bdbdc54cba16ae3c7e6d504d2fb Mon Sep 17 00:00:00 2001 From: Mikko Johansson Date: Sun, 9 Feb 2014 02:02:44 +0200 Subject: Skips tests on Windows that create files with illegal characters --- actionpack/test/dispatch/static_test.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'actionpack') diff --git a/actionpack/test/dispatch/static_test.rb b/actionpack/test/dispatch/static_test.rb index 5bd1806b21..01cca69288 100644 --- a/actionpack/test/dispatch/static_test.rb +++ b/actionpack/test/dispatch/static_test.rb @@ -136,10 +136,15 @@ module StaticTests def with_static_file(file) path = "#{FIXTURE_LOAD_PATH}/#{public_path}" + file - File.open(path, "wb+") { |f| f.write(file) } + begin + File.open(path, "wb+") { |f| f.write(file) } + rescue Errno::EPROTO + skip "Couldn't create a file #{path}" + end + yield file ensure - File.delete(path) + File.delete(path) if File.exists? path end end -- cgit v1.2.3