Module: Treebis::Test::TestPersistentDotfile

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

Instance Method Summary collapse

Instance Method Details

#test_delegate_toObject



1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
# File 'lib/treebis.rb', line 1333

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



1327
1328
1329
1330
1331
1332
# File 'lib/treebis.rb', line 1327

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