Permalink
Browse files

use Dir.tmpdir instead of /tmp/

  • Loading branch information...
1 parent 5838f40 commit 1422dea6bba34ef47d0ac099d2c3014e5042425f @jarmo jarmo committed Jul 11, 2011
Showing with 5 additions and 4 deletions.
  1. +5 −4 test/image_test.rb
View
@@ -1,6 +1,7 @@
require 'rubygems'
require 'test/unit'
require 'pathname'
+require 'tempfile'
require File.expand_path('../../lib/mini_magick', __FILE__)
#MiniMagick.processor = :gm
@@ -99,7 +100,7 @@ def test_image_write_with_space_in_output_path
def test_image_write_with_stream
stream = StringIO.new
image = Image.open(SIMPLE_IMAGE_PATH)
- image.write("/tmp/foo.gif")
+ image.write("#{Dir.tmpdir}/foo.gif")
image.write(stream)
# assert Image.read(stream.string).valid?
image.destroy!
@@ -282,7 +283,7 @@ def test_poop
img.gravity "Center"
img.crop "480x480"
img.resize "250x250"
- img.write "/tmp/output.png"
+ img.write "#{Dir.tmpdir}/output.png"
end
def test_throw_format_error
@@ -307,7 +308,7 @@ def test_import_pixels_default_format
assert_equal "png", image[:format].downcase
assert_equal columns, image[:width]
assert_equal rows, image[:height]
- image.write("/tmp/imported_pixels_image.png")
+ image.write("#{Dir.tmpdir}/imported_pixels_image.png")
end
def test_import_pixels_custom_format
@@ -323,7 +324,7 @@ def test_import_pixels_custom_format
assert_equal format, image[:format].downcase
assert_equal columns, image[:width]
assert_equal rows, image[:height]
- image.write("/tmp/imported_pixels_image." + format)
+ image.write("#{Dir.tmpdir}/imported_pixels_image." + format)
end
def test_mime_type

0 comments on commit 1422dea

Please sign in to comment.