зеркало из https://github.com/mozilla/labs-vcap.git
Allow frameworks to be diabled via configuration directive
This commit is contained in:
Родитель
7c11e6c76b
Коммит
3ce0df12f1
|
@ -0,0 +1,15 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe "A Framework should be able to be disabled" do
|
||||
|
||||
it 'should not list a disabled framework' do
|
||||
node_path = File.join(STAGING_TEMP, 'node.yml')
|
||||
node_manifest = File.read(node_path)
|
||||
node_manifest += "disabled: true"
|
||||
File.open(node_path, 'w') {|f| f.write(node_manifest) }
|
||||
StagingPlugin.load_all_manifests
|
||||
manifests = StagingPlugin.manifests
|
||||
manifests.should_not have_key 'node'
|
||||
end
|
||||
|
||||
end
|
|
@ -155,7 +155,11 @@ class StagingPlugin
|
|||
def self.load_manifest(path)
|
||||
framework = File.basename(path, '.yml')
|
||||
m = YAML.load_file(path)
|
||||
manifests[framework] = m
|
||||
unless m['disabled']
|
||||
manifests[framework] = m
|
||||
else
|
||||
manifests.delete(framework)
|
||||
end
|
||||
rescue
|
||||
puts "Failed to load staging manifest for #{framework} from #{path.inspect}"
|
||||
exit 1
|
||||
|
|
Загрузка…
Ссылка в новой задаче