Sha256: 192e28844680c81f131ecb381227b7ef0374f594aecdc2619e9ca0feb60d4551
Contents?: true
Size: 540 Bytes
Versions: 422
Compression:
Stored size: 540 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| assert file =~ /\.txt$/ end end end
Version data entries
422 entries across 422 versions & 1 rubygems