tests/test-html.rb
def moduleProvides?(m, mspec)
    # This one is interesting since the provides aren't explicitly stored in the
    # database. So the way we will test this is to grab all the modules referenced
    # and see if they do indeed require this module.

    # NOTE: This will only catch the cases where a module is providing for a non
    # existent module, or a module which doesn't depend on this. It will NOT catch
    # the cases where the module should be providing for a certain moudle and isn't
    # We will handle this case when we are checking the requires part of the module.

    provides = m.css("div.provides > span")

    # Check see if there is anything to test
    if not provides.empty?

      # For each module
      for span in provides
        code = span["class"]

        # Load its details from the database
        mod = getModuleByCode(code)

        # Do we really have to provide for this module
        if not mod["requires"].include? mspec["code"]
          add_issue("Module #{mspec["code"]} is providing for a module that it shouldn't be! (#{mod["code"]})")
        end
      end
    end
  end
# This function checks to see that a given module provides for the modules that
# it should
This function checks to see that a given module provides for the modules that
it should
This function checks to see that a given module provides for the modules that it should
def moduleProvides?(m, mspec)
    provides = m.css("div.provides > span")
    if not provides.empty?
      for span in provides
        code = span["class"]
        mod = getModuleByCode(code)
        if not mod["requires"].include? mspec["code"]
          add_issue("Module #{mspec["code"]} is providing for a module that it shouldn't be! (#{mod["code"]})")
        end
      end
    end
  end
def moduleProvides? ( m , mspec ) provides = m . css ( "div.provides > span" ) if not provides . empty? for span in provides code = span [ "class" ] mod = getModuleByCode ( code ) if not mod [ "requires" ] . include? mspec [ "code" ] add_issue ( "Module #{mspec["code"]} is providing for a module that it shouldn't be! (#{mod["code"]})" ) end end end end
This function checks to see that a given module provides for the modules that
it should
This function checks to see that a given module provides for the modules that it should
# This one is interesting since the provides aren't explicitly stored in the # database. So the way we will test this is to grab all the modules referenced # and see if they do indeed require this module. # NOTE: This will only catch the cases where a module is providing for a non # existent module, or a module which doesn't depend on this. It will NOT catch # the cases where the module should be providing for a certain moudle and isn't # We will handle this case when we are checking the requires part of the module. # Check see if there is anything to test # For each module # Load its details from the database # Do we really have to provide for this module
m
mspec