Sinject::Container#register will check that a key parameter has been provided and raise an error if it is absent. However, it does not check that the key is non-nil.
Steps to reproduce:
require 'sinject'
container = Sinject::Container.new(false)
container.register(key: nil, class: Object)
Expected:
Sinject::DependencyRegistrationKeyNotSpecifiedException or similar to be raised.
Actual:
Sinject::Container#registerwill check that akeyparameter has been provided and raise an error if it is absent. However, it does not check that the key is non-nil.Steps to reproduce:
Expected:
Sinject::DependencyRegistrationKeyNotSpecifiedExceptionor similar to be raised.Actual:
Nothing is raised.
container.get(nil)returns an instance ofObject.