Sha256: 7d5dd85e8c6bacad172420e816f77b2d2f72af2f0688f041e9cd09b36333c1d1
Contents?: true
Size: 887 Bytes
Versions: 7
Compression:
Stored size: 887 Bytes
Contents
require File.expand_path(__FILE__).sub(%r(/test/.*), '/test/test_helper.rb') require File.expand_path(__FILE__).sub(%r(.*/test/), '').sub(/test_(.*)\.rb/,'\1') require 'scout/resource' class TestResourcePath < Test::Unit::TestCase module TestResource extend Resource self.subdir = Path.setup('tmp/test-resource_alt') claim self.tmp.test.string, :string, "TEST" end def teardown FileUtils.rm_rf TestResource.root.find end def test_read assert_include TestResource.tmp.test.string.read, "TEST" end def test_open str = "" TestResource.tmp.test.string.open do |f| str = f.read end assert_include str, "TEST" end def test_write TmpFile.with_file do |tmpfile| Path.setup(tmpfile) tmpfile.foo.bar.write do |f| f.puts "TEST" end assert_include tmpfile.foo.bar.read, "TEST" end end end
Version data entries
7 entries across 7 versions & 1 rubygems