This adds _brs_.resetMockFunction and _brs_.resetMockComponent so that you can reset a single mocked function or component. Also, it comes with a couple of bug fixes and improvements in that area:
_brs_.resetMockComponents wasn't actually resetting the "scoped" mocks for any specific environment (which is how mockComponentPartial works behind the scenes. Now, it does.
We weren't plumbing through the subtype for a mocked component, which would cause lookups to fail when we tried to do something like mockedNode.callFunc("func"). Now, this works.
Our component type definition map was case-sensitive, which was causing some headaches for differentiating between a node mock and a built-in object mock (the object map was not case sensitive). Also, you can have a component called name="CamelCase" and still run createObject("rosgnode", "camelcase") successfully, so there was no need to to store it case-sensitive.
Re-organized the test directory for our mock extension unit tests (sorry, it's a lot of file changes! most of the 47 changed files are in the tests/ directory)
Change Summary
Closes #517
This adds
_brs_.resetMockFunction
and_brs_.resetMockComponent
so that you can reset a single mocked function or component. Also, it comes with a couple of bug fixes and improvements in that area:_brs_.resetMockComponents
wasn't actually resetting the "scoped" mocks for any specific environment (which is howmockComponentPartial
works behind the scenes. Now, it does.mockedNode.callFunc("func")
. Now, this works.name="CamelCase"
and still runcreateObject("rosgnode", "camelcase")
successfully, so there was no need to to store it case-sensitive.tests/
directory)