@Then I see that a/an :name role exists

Verifies that a role with $name exists.
435867
public function iSeeRole( $name )
    {
        $role = $this->getRoleManager()->getRole( $name );
        Assertion::assertNotNull(
            $role,
            "Couldn't find Role with name $name"
        );
    }
176093
def add_role name
      if allowed_role? name
        return if has_role? name
        role = Role.find_by(name: name.to_s)
        roles << role
      end
    end
155455
public function exists($name): bool
    {
        $filename = $this->getFilename($name);
        if ($filename === false) {
            return false;
        }

        return true;
    }
1014554
public function exists($name): bool
    {
        return Container::getCache()->get($this->getCacheKey($name)) === null;
    }
729283
public function hasAccess($name)
    {
        $permissions = $this->getPermissions($name);
        $roles       = $this->getRoles($name);

        if ($permissions === null && $roles === null) {
            return null;
        }

        return $this->keeper->hasPermissions($permissions) === true && $this->keeper->hasRoles($roles) === true;
    }
699895
public function __isset($name)
    {
        return ($name && parent::__isset($name)) || isset($this->params[$name]);
    }
309860
public function __isset($name)
    {
        if (isset($this->instances[$name])) {
            return true;
        } elseif (isset($this->autoloader)) {
            try {
                $this->$name;
                return true;
            } catch (InvalidModuleException $e) {
            }
        }
        return false;
    }
309578
public function exists($name)
    {
        if (!$this->validateCmsObject($name)) {
            return parent::exists($name);
        }

        return $this->obj->exists;
    }
322445
public function hasRole($role, $user = null)
    {
        $roleName = $role instanceof Role ? $role->getRole() : $role;

        $user = $user ?: $this->getUser();

        if (!($user instanceof UserInterface)) {
            return false;
        }

        if (null === $this->roleHierarchy) {
            return in_array($roleName, $user->getRoles(), true);
        }

        $userRoles = $this->roleHierarchy->getReachableRoles($this->getUserRolesAsObjects($user));
        foreach ($userRoles as $userRole) {
            if ($roleName === $userRole->getRole()) {
                return true;
            }
        }

        return false;
    }
256663
public function has($name, $checkAbstractFactories = true, $usePeeringServiceManagers = false)
    {
        if (is_string($name) && $this->container->has($name)) {
            return true;
        } elseif (parent::has($name, $checkAbstractFactories, $usePeeringServiceManagers)) {
            return true;
        }

        return false;
    }
1322258
def has_role?(role_in_question)
      return false unless role
      return true if role.name == role_in_question
      case role.name
      when 'Administrator'
        return true
      when 'Librarian'
        return true if role_in_question == 'User'
      else
        false
      end
    end
35527
public function exists($name = null)
    {
        if ($name === null) {
            $name = $this->mainname;
        }
        return isset($this->dbs[$name]);
    }
732848
public function exists($name)
    {
        $loader = $this->environment->getLoader();

        try {
            $loader->getSource((string) $name);
        } catch (\Twig_Error_Loader $e) {
            return false;
        }

        return true;
    }
477500
public function hasRole($role) {
		if (empty($role) || !\is_numeric($role)) {
			return false;
		}

		if (isset($_SESSION) && isset($_SESSION[self::SESSION_FIELD_ROLES])) {
			$role = (int) $role;

			return (((int) $_SESSION[self::SESSION_FIELD_ROLES]) & $role) === $role;
		}
		else {
			return false;
		}
	}
729266
public function object_exists( $name ) {
		
		$this->object = $this->bucket->object( $name );
		return $this->object->exists();
		
	}
730702
public function hasDirectRole($name)
    {
        foreach ($this->roles as $role) {
            if ($role->name == $name) {
                return true;
            }
        }

        return false;
    }
1008207
public function ensureRoleExists( $name )
    {
         /** @var \eZ\Publish\API\Repository\Repository $repository */
        $repository = $this->getRepository();
        $that = $this;
        $role = $repository->sudo(
            function() use( $repository, $name, $that )
            {
                $role = null;
                $roleService = $repository->getRoleService();

                // make sure role name starts with uppercase as this is what default setup provides
                if ($name !== ucfirst($name)) {
                    @trigger_error(
                        "'{$name}' role name should start with uppercase letter",
                        E_USER_DEPRECATED
                    );
                }

                try
                {
                    $role = $roleService->loadRoleByIdentifier(ucfirst($name));
                }
                catch ( ApiExceptions\NotFoundException $e )
                {
                    $roleCreateStruct = $roleService->newRoleCreateStruct(ucfirst($name));
                    $roleDraft = $roleService->createRole( $roleCreateStruct );
                    $roleService->publishRoleDraft($roleDraft);
                    $role = $roleService->loadRole($roleDraft->id);
                    $that->addObjectToList( $role );
                }

                return $role;
            }
        );

        return $role;
    }