Skip to content

Implement GlobalScope, BuildScope and TestScope #4

Open
@bsutton

Description

@bsutton

Consider implementing the noted classes.

GlobalScope - replacement for getit but interacts with TestScope

  • a singleton with a method called guse()

BlockScope - replacement for provider but interacts with TestScope

  • a provider replacement with a method called 'buse()'

XXXTestScope
The intent of TestScope is to alter the behaviour of other scopes when unit testing.

GlobalScope
as a singleton gs presents problems when running unit tests as each test may need a different set of settings.

To alter GlobalScope's behaviour during unit tests add a GlobalTestScope.
If a GlobalScope detects a GlobalTestScope on the stack (or in the build context?) then the values of the GlobalTestScope are
used in preference to the GlobalScope.
We need to consider the fact that a GlobalScope is called on the call stack as well as the build stack so we need to work out how to inject the GlobalTestScope into both of these.

BuildScope
Same as GlobalScope but we are on the build stack.

Scope
the same IOC but just for the call stack.
We could possibly allow these to be nested with the highest level scope taking precedence (essentially we are reversing the priority).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions