Skip to content

Commit

Permalink
Merge 5df54a3 into a31229c
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmancuso committed Jan 6, 2019
2 parents a31229c + 5df54a3 commit 433ee2b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions masonite/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,3 +348,6 @@ def _find_obj(self, obj):

raise MissingContainerBindingNotFound(
'The dependency with the {0} annotation could not be resolved by the container'.format(obj))

def __contains__(self, obj):
return self.has(obj)
6 changes: 6 additions & 0 deletions tests/test_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ def test_can_substitute_with_object(self):

assert isinstance(app.resolve(self._test_substitute), MakeObject)

def test_can_use_in_keyword(self):
app = App()
app.bind('test', 'value')

assert 'test' in app

def test_can_substitute_with_make_object(self):
app = App()
app.swap(SubstituteThis, MakeObject())
Expand Down

0 comments on commit 433ee2b

Please sign in to comment.