Sha256: 315b4ffee56e9936065902460623b25498cdad4e975414786f00c15fdbee009d
Contents?: true
Size: 941 Bytes
Versions: 40
Compression:
Stored size: 941 Bytes
Contents
require File.expand_path("../../base", __FILE__) describe Vagrant::Hosts do let(:registry) { Vagrant::Registry.new } it "detects the host that matches true" do foo_klass = Class.new(Vagrant::Hosts::Base) do def self.match?; false; end end bar_klass = Class.new(Vagrant::Hosts::Base) do def self.match?; true; end end registry.register(:foo, foo_klass) registry.register(:bar, bar_klass) described_class.detect(registry).should == bar_klass end it "detects the host that matches true with the highest precedence first" do foo_klass = Class.new(Vagrant::Hosts::Base) do def self.match?; true; end end bar_klass = Class.new(Vagrant::Hosts::Base) do def self.match?; true; end def self.precedence; 9; end end registry.register(:foo, foo_klass) registry.register(:bar, bar_klass) described_class.detect(registry).should == bar_klass end end
Version data entries
40 entries across 40 versions & 6 rubygems