Module: Treebis::Test::TestPersistentDotfile

Included in:
TestCase
Defined in:
lib/treebis.rb

Instance Method Summary collapse

Instance Method Details

#test_delegate_toObject



1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
# File 'lib/treebis.rb', line 1319

def test_delegate_to
  parent_mod = Module.new
  Treebis::PersistentDotfile.extend_to(
    parent_mod, TestCase::DotfilePath
  )
  child_mod = Module.new
  child_mod2 = Module.new
  parent_mod.persistent_delegate_to(child_mod)
  parent_mod.persistent_delegate_to(child_mod2)
  foo = parent_mod.empty_tmpdir('bliz')
  bar = child_mod.empty_tmpdir('bliz')
  baz = child_mod2.empty_tmpdir('bliz')
  assert_equal(foo, bar)
  assert_equal(foo, baz)
end

#test_persistent_dotfile_empty_tempdirObject



1313
1314
1315
1316
1317
1318
# File 'lib/treebis.rb', line 1313

def test_persistent_dotfile_empty_tempdir
  blah1 = empty_tmpdir('blah/blah')
  blah2 = empty_tmpdir('blah/blah')
  assert_equal(blah1, blah2)
  assert_equal({}, dir_as_hash(blah2))
end