Sha256: 13cb4c37de6ac64604e668105828325f953bc3e936c96b062ca1502eac0aae0e

Contents?: true

Size: 726 Bytes

Versions: 5

Compression:

Stored size: 726 Bytes

Contents

# -*- coding: utf-8 -*-
"""
    Pygments string assert utility
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
"""

class StringTests(object):

    def assertStartsWith(self, haystack, needle, msg=None):
        if msg is None:
            msg = "'{}' does not start with '{}'".format(haystack, needle)
        if not haystack.startswith(needle):
            raise(AssertionError(msg))

    def assertEndsWith(self, haystack, needle, msg=None):
        if msg is None:
            msg = "'{}' does not end with '{}'".format(haystack, needle)
        if not haystack.endswith(needle):
            raise(AssertionError(msg))

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/gems/pygments.rb-0.6.3/vendor/pygments-main/tests/string_asserts.py
pygments.rb-0.6.3 vendor/pygments-main/tests/string_asserts.py
pygments.rb-0.6.2 vendor/pygments-main/tests/string_asserts.py
pygments.rb-0.6.1 vendor/pygments-main/tests/string_asserts.py
pygments.rb-0.6.0 vendor/pygments-main/tests/string_asserts.py