mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 01:58:41 -05:00
Adds a new mechanism to load providers from any gem or file path. (#263)
* Adds ability to load only providers used in config file
This commit is contained in:
parent
0a769b8901
commit
2daa5244b8
13 changed files with 316 additions and 15 deletions
|
|
@ -46,6 +46,30 @@ EOT
|
|||
end
|
||||
end
|
||||
|
||||
describe '#load_used_providers' do
|
||||
let(:config) { YAML.load(<<-EOT
|
||||
---
|
||||
:config:
|
||||
:providers:
|
||||
:mock:
|
||||
:pools:
|
||||
- name: '#{pool}'
|
||||
size: 1
|
||||
provider: 'spoof'
|
||||
EOT
|
||||
)
|
||||
}
|
||||
it do
|
||||
files = ["#{project_root_dir}/lib/vmpooler/providers/vsphere.rb",
|
||||
"#{project_root_dir}/lib/vmpooler/providers/dummy.rb"]
|
||||
expect(subject.load_used_providers).to eq(files)
|
||||
end
|
||||
end
|
||||
|
||||
it '#default_providers' do
|
||||
expect(subject.default_providers).to eq(['vsphere', 'dummy'])
|
||||
end
|
||||
|
||||
describe '#check_pending_vm' do
|
||||
before do
|
||||
expect(subject).not_to be_nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue