class TestSiteML

Public Instance Methods

check_a_site(site) click to toggle source
# File vendor/qwik/lib/qwik/site-group.rb, line 75
def check_a_site(site)
  # At the first, there is no file here.
  ok_eq(true, site.inactive?(Time.at(0)))

  # Create a new page with time 0.
  page = site.create_new
  page.put_with_time('a', 0)
  ok_eq(false, site.inactive?(Time.at(0)))

  # Change the life time to 0.
  page = site['_SiteConfig']
  page.put_with_time(':ml_life_time:0', 0)  # Die soon.
  ok_eq(true, site.inactive?(Time.at(0 + Qwik::Site::ML_LIFE_TIME_ALLOWANCE)))

  # Set GroupConfig to forward mode.
  page = site.create('_GroupConfig')
  page.put_with_time(':forward:true', 0)    # forward mode.
  ok_eq(false, site.inactive?(Time.at(0)))
end
test_all() click to toggle source
# File vendor/qwik/lib/qwik/site-group.rb, line 95
def test_all
  # test_inactive
  check_a_site(@site)

  # test_inactive_top_site
  check_a_site(@memory.farm.get_top_site)
end