Sha256: 89aea9f0e17e1f98a6dd13cee8c6a3a201a43d98cea9cbd459870ed40b259d3e
Contents?: true
Size: 555 Bytes
Versions: 134
Compression:
Stored size: 555 Bytes
Contents
require File.expand_path(File.dirname(__FILE__) + '/../../test_helper') require 'rbbt/util/tmpfile' require 'test/unit' class TestTmpFile < Test::Unit::TestCase def test_tmp_file assert(TmpFile.tmp_file("test") =~ /tmp\/test\d+$/) end def test_do_tmp_file content = "Hello World!" TmpFile.with_file(content) do |file| assert_equal content, File.open(file).read end end def test_extension TmpFile.with_file(nil, true, :extension => 'txt') do |file| ddd file assert file =~ /\.txt$/ end end end
Version data entries
134 entries across 134 versions & 1 rubygems