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

Add synchronizedResolver property to Assembler #445

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add synchronizedResolver property to Assembler
  • Loading branch information
devxoul committed Feb 25, 2020
commit 5f6a0c0e45b27c83d51e3022b330d0ccc789e9ba
7 changes: 7 additions & 0 deletions Sources/Assembler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ public final class Assembler {
return container
}

/// expose the container's synchornized resolver.
///
/// - seealso: `Container.synchronize`
public var synchronizedResolver: Resolver {
return container.synchronize()
}

/// Will create an empty `Assembler`
///
/// - parameter container: the baseline container
Expand Down
10 changes: 10 additions & 0 deletions Tests/SwinjectTests/AssemblerSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -325,5 +325,15 @@ class AssemblerSpec: QuickSpec {
expect(spy.entries).to(haveCount(1))
}
}

describe("Synchronized Resolver") {
it("returns synchrozed resolver") {
let assembler = Assembler([
AnimalAssembly(),
])
let resolver = assembler.synchronizedResolver
expect(resolver).to(beAKindOf(SynchronizedResolver.self))
}
}
}
}