Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment for mocked component is wrong #574

Open
lkipke opened this issue Nov 5, 2020 · 1 comment
Open

Environment for mocked component is wrong #574

lkipke opened this issue Nov 5, 2020 · 1 comment
Labels
bug Any difference between this BrightScript implementation and RBI, or otherwise unexpected behavior

Comments

@lkipke
Copy link
Collaborator

lkipke commented Nov 5, 2020

Example:

In testcase.test.brs:

_brs_.mockComponent("DependencyComponent", {
    helloWorld: function()
        return m.top.subtype()
    end function
})

In MyComponent.brs:

dep = createObject("roSGNode", "dependencyComponent")
print dep.helloWorld() ' => "MyComponent"

It seems like the environment isn't getting seeded correctly for a member method.

@lkipke lkipke added the bug Any difference between this BrightScript implementation and RBI, or otherwise unexpected behavior label Nov 5, 2020
@Vasya-M
Copy link
Contributor

Vasya-M commented Nov 10, 2020

just want to add a note that brs has the same behavior if use dep.callFunc("helloWorld").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Any difference between this BrightScript implementation and RBI, or otherwise unexpected behavior
Projects
None yet
Development

No branches or pull requests

2 participants