def METHOD_NAME(self):
    if check_status() is False:
        self.skipTest("External resource 'https://rubygems.org' is not available")
    self.GEM = "tidy"
    self.GEM_VER = "1.1.2"
    self.OLD_GEM = "brass"
    self.OLD_VERSION = "1.0.0"
    self.NEW_VERSION = "1.2.1"
    self.GEM_LIST = [self.GEM, self.OLD_GEM]
    for name in (
        "GEM",
        "GEM_VER",
        "OLD_GEM",
        "OLD_VERSION",
        "NEW_VERSION",
        "GEM_LIST",
    ):
        self.addCleanup(delattr, self, name)
    def uninstall_gem():
        # Remove gem if it is already installed
        if self.run_function("gem.list", [self.GEM]):
            self.run_function("gem.uninstall", [self.GEM])
    self.addCleanup(uninstall_gem)