Do not use Enumerable in Registry
Calling methods like #first in Registry is misleading because it returns a different result than registry.get(registry.keys.first).
This commit is contained in:
parent
c0b107ff69
commit
d79a0d52dd
|
@ -4,8 +4,6 @@ module Vagrant
|
|||
# This allows certain components (such as guest systems, configuration
|
||||
# pieces, etc.) to be registered and queried, lazily.
|
||||
class Registry
|
||||
include Enumerable
|
||||
|
||||
def initialize
|
||||
@items = {}
|
||||
@results_cache = {}
|
||||
|
|
|
@ -3,10 +3,6 @@ require File.expand_path("../../base", __FILE__)
|
|||
describe Vagrant::Registry do
|
||||
let(:instance) { described_class.new }
|
||||
|
||||
it "should include enumerable" do
|
||||
expect(instance).to be_a(Enumerable)
|
||||
end
|
||||
|
||||
it "should return nil for nonexistent items" do
|
||||
expect(instance.get("foo")).to be_nil
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue