Permalink
Browse files

drop support to "should.matcher" syntax

  • Loading branch information...
1 parent 15096f6 commit 66e2f9d9cc92ac925c783982846d1fcfed43b95f @rodrigomanhaes rodrigomanhaes committed Dec 8, 2010
View
@@ -40,16 +40,3 @@ A nice example of exceptions would be::
...
ShouldNotSatisfied: 'should' does include 'oul'
-
-
-All Should-DSL releases **before 2.0** uses a deprecated style, although we still support this old style, it will be dropped soon and we discourage you to use that style. Old style usage like::
-
- >>> 3 |should_not.equal_to| 2.99
-
-should be written as::
-
- >>> 3 |should_not| equal_to(2.99)
-
-
-This new syntax for writing expectations has been changed because the requirement to have a single "right value" had been a limition to write new matchers and add other enhancements to Should-DSL and you should update the code that uses old style, because we plan to remove them soon.
-
@@ -4,5 +4,5 @@
>>> @matcher
... def be_the_square_root_of():
... return (lambda x, y: x == math.sqrt(y), "%s is %sthe square root of %s")
->>> 3 |should.be_the_square_root_of| 9
+>>> 3 |should| be_the_square_root_of(9)
@@ -21,3 +21,9 @@ Traceback (most recent call last):
...
NameError: name 'should_not_have' is not defined
+
+>>> "Brasil" |should.end_with| "sil"
+Traceback (most recent call last):
+ ...
+AttributeError: ...
+
@@ -1,7 +0,0 @@
->>> from should_dsl import *
-
->>> 10 |should.be_the_maximum_of| [1, 2, 10]
-Traceback (most recent call last):
-...
-AttributeError: Should object has no matcher 'be_the_maximum_of'
-
View
@@ -137,24 +137,6 @@ def _put_predicate_matchers_on_namespace(self):
def _get_all_public_attr_names(self, obj):
return [attr_name for attr_name in dir(obj) if not attr_name.startswith('_')]
- # deprecated behaviour
- def __getattr__(self, method_name):
- if method_name not in self._matchers_by_name:
- raise AttributeError("%s object has no matcher '%s'" % (
- self.__class__.__name__, method_name))
- return self._prepare_to_receive_rvalue(method_name)
-
- def _prepare_to_receive_rvalue(self, method_name):
- should = Should(negate=self._negate)
- should._matchers_by_name = self._matchers_by_name
- should._old_style_call = True
- should._matcher = self._matchers_by_name[method_name]
- return should
-
- def _convert_deprecated_style(self, rvalue):
- self._rvalue = self._matcher()
- self._rvalue.arg = rvalue
-
class _PredicateMatcher(object):

0 comments on commit 66e2f9d

Please sign in to comment.