| Total Complexity | 3 |
| Total Lines | 12 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | __author__ = "Chris Rose" |
||
| 12 | class StringMatchesPattern(BaseMatcher): |
||
| 13 | |||
| 14 | def __init__(self, pattern): |
||
| 15 | self.pattern = pattern |
||
| 16 | |||
| 17 | def describe_to(self, description): |
||
| 18 | description.append_text("a string matching '") \ |
||
| 19 | .append_text(self.pattern.pattern) \ |
||
| 20 | .append_text("'") |
||
| 21 | |||
| 22 | def _matches(self, item): |
||
| 23 | return self.pattern.search(item) is not None |
||
| 24 | |||
| 41 |