capybara/result.py
def compare_count(self):
        """
        Returns how the result count compares to the query options.

        The return value is negative if too few results were found, zero if enough were found, and
        positive if too many were found.

        Returns:
            int: -1, 0, or 1.
        """

        if self.query.options["count"] is not None:
            count_opt = int(self.query.options["count"])
            self._cache_at_least(count_opt + 1)
            return cmp(len(self._result_cache), count_opt)

        if self.query.options["minimum"] is not None:
            min_opt = int(self.query.options["minimum"])
            if not self._cache_at_least(min_opt):
                return -1

        if self.query.options["maximum"] is not None:
            max_opt = int(self.query.options["maximum"])
            if self._cache_at_least(max_opt + 1):
                return 1

        if self.query.options["between"] is not None:
            between = self.query.options["between"]
            min_opt, max_opt = between[0], between[-1]
            if not self._cache_at_least(min_opt):
                return -1
            if self._cache_at_least(max_opt + 1):
                return 1
            return 0

        return 0
def compare_count(self):
        if self.query.options["count"] is not None:
            count_opt = int(self.query.options["count"])
            self._cache_at_least(count_opt + 1)
            return cmp(len(self._result_cache), count_opt)

        if self.query.options["minimum"] is not None:
            min_opt = int(self.query.options["minimum"])
            if not self._cache_at_least(min_opt):
                return -1

        if self.query.options["maximum"] is not None:
            max_opt = int(self.query.options["maximum"])
            if self._cache_at_least(max_opt + 1):
                return 1

        if self.query.options["between"] is not None:
            between = self.query.options["between"]
            min_opt, max_opt = between[0], between[-1]
            if not self._cache_at_least(min_opt):
                return -1
            if self._cache_at_least(max_opt + 1):
                return 1
            return 0

        return 0
def compare_count ( self ) : if self . query . options [ "count" ] is not None : count_opt = int ( self . query . options [ "count" ] ) self . _cache_at_least ( count_opt + 1 ) return cmp ( len ( self . _result_cache ) , count_opt ) if self . query . options [ "minimum" ] is not None : min_opt = int ( self . query . options [ "minimum" ] ) if not self . _cache_at_least ( min_opt ) : return - 1 if self . query . options [ "maximum" ] is not None : max_opt = int ( self . query . options [ "maximum" ] ) if self . _cache_at_least ( max_opt + 1 ) : return 1 if self . query . options [ "between" ] is not None : between = self . query . options [ "between" ] min_opt , max_opt = between [ 0 ] , between [ - 1 ] if not self . _cache_at_least ( min_opt ) : return - 1 if self . _cache_at_least ( max_opt + 1 ) : return 1 return 0 return 0
Returns how the result count compares to the query options.

        The return value is negative if too few results were found, zero if enough were found, and
        positive if too many were found.

        Returns:
            int: -1, 0, or 1.
Returns how the result count compares to the query options .