| Total Complexity | 3 |
| Total Lines | 12 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | __author__ = "Jon Reid" |
||
| 9 | class SubstringMatcher(BaseMatcher): |
||
| 10 | |||
| 11 | def __init__(self, substring): |
||
| 12 | if not isinstance(substring, six.string_types): |
||
| 13 | raise TypeError(self.__class__.__name__ + ' requires string') |
||
| 14 | self.substring = substring |
||
| 15 | |||
| 16 | def describe_to(self, description): |
||
| 17 | description.append_text('a string ') \ |
||
| 18 | .append_text(self.relationship()) \ |
||
| 19 | .append_text(' ') \ |
||
| 20 | .append_description_of(self.substring) |
||
| 21 |