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

Mock and DependencyInjection helper. #1

Merged
merged 4 commits into from Nov 2, 2011
Merged

Mock and DependencyInjection helper. #1

merged 4 commits into from Nov 2, 2011

Conversation

ghost
Copy link

@ghost ghost commented Nov 2, 2011

Usage is as follows.

Testee := Object clone do(meth := method(System version println; System activeCpus println))
t1 := Testee clone
t2 := Testee clone

For yet undefined Objects use a String for the type.

b := Mock mocking("System")
b activeCpus := 100
b version := 5

If the object already exists you can provide it directly and non overridden Methods will be invoked as usual.

m := Mock mocking(System)
m activeCpus := 100

b injectInto(t1)
m injectInto(t2)

Io> t1 meth
5
100

Io> t2 meth
20110905
100

jeremytregunna added a commit that referenced this pull request Nov 2, 2011
Mock and DependencyInjection helper.
@jeremytregunna jeremytregunna merged commit 10bfd99 into jeremytregunna:master Nov 2, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants