tests/test-html.rb
def allModules?(course)
    modules = @html.css("div.module")

    # Get all of their ids
    modids = modules.map { |m| m["id"]  }

    if modids.length != modids.uniq.length
      add_issue("Page contains duplicate modules!")
    end

    if modids.length > getAllModuleCodes(course).length
      add_issue("Page contains modules that are not offered by this course!")
    end

    if modules.length < getAllModuleCodes(course).length
      add_issue("Page is missing modules from this course!")
    end
  end
# Checks to make sure the correct modules are included once and once only
Checks to make sure the correct modules are included once and once only
Checks to make sure the correct modules are included once and once only
def allModules?(course)
    modules = @html.css("div.module")
    modids = modules.map { |m| m["id"]  }
    if modids.length != modids.uniq.length
      add_issue("Page contains duplicate modules!")
    end
    if modids.length > getAllModuleCodes(course).length
      add_issue("Page contains modules that are not offered by this course!")
    end
    if modules.length < getAllModuleCodes(course).length
      add_issue("Page is missing modules from this course!")
    end
  end
def allModules? ( course ) modules = @html . css ( "div.module" ) modids = modules . map { | m | m [ "id" ] } if modids . length != modids . uniq . length add_issue ( "Page contains duplicate modules!" ) end if modids . length > getAllModuleCodes ( course ) . length add_issue ( "Page contains modules that are not offered by this course!" ) end if modules . length < getAllModuleCodes ( course ) . length add_issue ( "Page is missing modules from this course!" ) end end
Checks to make sure the correct modules are included once and once only
Checks to make sure the correct modules are included once and once only
# Get all of their ids
course