puppet 3.5.1-x86-mingw32 → 3.6.0.rc1-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- data/CONTRIBUTING.md +5 -0
- data/Gemfile +17 -9
- data/README.md +1 -0
- data/conf/fileserver.conf +4 -3
- data/ext/README.environment +8 -0
- data/ext/build_defaults.yaml +1 -1
- data/ext/debian/control +2 -2
- data/ext/debian/puppet-common.dirs +4 -0
- data/ext/debian/rules +4 -0
- data/ext/emacs/puppet-mode-init.el +1 -1
- data/ext/emacs/puppet-mode.el +36 -17
- data/ext/redhat/client.init +3 -3
- data/ext/redhat/puppet.spec.erb +9 -0
- data/ext/systemd/puppet.service +3 -4
- data/ext/systemd/puppetmaster.service +1 -3
- data/install.rb +1 -1
- data/lib/puppet.rb +2 -1
- data/lib/puppet/agent.rb +1 -1
- data/lib/puppet/application.rb +17 -17
- data/lib/puppet/application/doc.rb +1 -1
- data/lib/puppet/configurer.rb +4 -1
- data/lib/puppet/configurer/downloader.rb +13 -12
- data/lib/puppet/configurer/plugin_handler.rb +3 -3
- data/lib/puppet/context.rb +6 -1
- data/lib/puppet/defaults.rb +82 -12
- data/lib/puppet/environments.rb +169 -13
- data/lib/puppet/external/nagios/grammar.ry +2 -0
- data/lib/puppet/external/nagios/parser.rb +28 -19
- data/lib/puppet/face/config.rb +19 -6
- data/lib/puppet/face/module/generate.rb +209 -7
- data/lib/puppet/face/module/install.rb +17 -16
- data/lib/puppet/face/module/list.rb +83 -82
- data/lib/puppet/face/module/search.rb +1 -1
- data/lib/puppet/face/module/upgrade.rb +10 -9
- data/lib/puppet/face/parser.rb +3 -2
- data/lib/puppet/face/plugin.rb +8 -4
- data/lib/puppet/file_bucket/dipper.rb +6 -3
- data/lib/puppet/file_bucket/file.rb +4 -2
- data/lib/puppet/file_serving/metadata.rb +1 -1
- data/lib/puppet/file_system/memory_file.rb +27 -1
- data/lib/puppet/file_system/memory_impl.rb +15 -1
- data/lib/puppet/forge.rb +148 -52
- data/lib/puppet/forge/cache.rb +5 -1
- data/lib/puppet/forge/errors.rb +10 -0
- data/lib/puppet/forge/repository.rb +61 -26
- data/lib/puppet/functions.rb +548 -0
- data/lib/puppet/functions/assert_type.rb +42 -0
- data/lib/puppet/functions/import.rb +7 -0
- data/lib/puppet/indirector/facts/facter.rb +1 -1
- data/lib/puppet/indirector/file_bucket_file/file.rb +3 -2
- data/lib/puppet/indirector/rest.rb +18 -0
- data/lib/puppet/loaders.rb +20 -0
- data/lib/puppet/module.rb +2 -2
- data/lib/puppet/module_tool.rb +40 -14
- data/lib/puppet/module_tool/applications.rb +0 -1
- data/lib/puppet/module_tool/applications/application.rb +35 -26
- data/lib/puppet/module_tool/applications/builder.rb +16 -6
- data/lib/puppet/module_tool/applications/checksummer.rb +25 -19
- data/lib/puppet/module_tool/applications/installer.rb +196 -35
- data/lib/puppet/module_tool/applications/searcher.rb +1 -0
- data/lib/puppet/module_tool/applications/uninstaller.rb +7 -1
- data/lib/puppet/module_tool/applications/unpacker.rb +57 -31
- data/lib/puppet/module_tool/applications/upgrader.rb +221 -65
- data/lib/puppet/module_tool/checksums.rb +5 -8
- data/lib/puppet/module_tool/errors/installer.rb +12 -44
- data/lib/puppet/module_tool/errors/shared.rb +84 -11
- data/lib/puppet/module_tool/errors/upgrader.rb +16 -45
- data/lib/puppet/module_tool/install_directory.rb +7 -6
- data/lib/puppet/module_tool/installed_modules.rb +92 -0
- data/lib/puppet/module_tool/local_tarball.rb +91 -0
- data/lib/puppet/module_tool/metadata.rb +119 -115
- data/lib/puppet/module_tool/modulefile.rb +9 -9
- data/lib/puppet/module_tool/shared_behaviors.rb +19 -7
- data/lib/puppet/module_tool/skeleton/templates/generator/README.md.erb +79 -0
- data/lib/puppet/module_tool/skeleton/templates/generator/Rakefile +18 -0
- data/lib/puppet/module_tool/skeleton/templates/generator/metadata.json.erb +1 -0
- data/lib/puppet/module_tool/skeleton/templates/generator/spec/classes/init_spec.rb.erb +7 -0
- data/lib/puppet/module_tool/tar.rb +3 -7
- data/lib/puppet/module_tool/tar/gnu.rb +21 -9
- data/lib/puppet/module_tool/tar/mini.rb +2 -8
- data/lib/puppet/network/http/api/v1.rb +1 -1
- data/lib/puppet/network/http/api/v2/authorization.rb +4 -2
- data/lib/puppet/network/http/issues.rb +1 -0
- data/lib/puppet/network/http_pool.rb +15 -6
- data/lib/puppet/node/environment.rb +91 -20
- data/lib/puppet/parser/ast/pops_bridge.rb +44 -3
- data/lib/puppet/parser/collector.rb +1 -1
- data/lib/puppet/parser/compiler.rb +50 -7
- data/lib/puppet/parser/functions.rb +6 -0
- data/lib/puppet/parser/functions/generate.rb +1 -1
- data/lib/puppet/parser/resource.rb +1 -1
- data/lib/puppet/pops.rb +22 -1
- data/lib/puppet/pops/adapters.rb +8 -1
- data/lib/puppet/pops/binder/bindings_composer.rb +1 -1
- data/lib/puppet/pops/binder/bindings_factory.rb +1 -1
- data/lib/puppet/pops/binder/config/binder_config_checker.rb +1 -1
- data/lib/puppet/pops/binder/producers.rb +2 -2
- data/lib/puppet/pops/evaluator/access_operator.rb +65 -25
- data/lib/puppet/pops/evaluator/callable_signature.rb +101 -0
- data/lib/puppet/pops/evaluator/closure.rb +57 -2
- data/lib/puppet/pops/evaluator/compare_operator.rb +1 -1
- data/lib/puppet/pops/evaluator/evaluator_impl.rb +9 -11
- data/lib/puppet/pops/evaluator/runtime3_support.rb +72 -21
- data/lib/puppet/pops/functions/dispatch.rb +71 -0
- data/lib/puppet/pops/functions/dispatcher.rb +237 -0
- data/lib/puppet/pops/functions/function.rb +77 -0
- data/lib/puppet/pops/issues.rb +12 -0
- data/lib/puppet/pops/loader/base_loader.rb +102 -0
- data/lib/puppet/pops/loader/dependency_loader.rb +60 -0
- data/lib/puppet/pops/loader/gem_support.rb +49 -0
- data/lib/puppet/pops/loader/loader.rb +180 -0
- data/lib/puppet/pops/loader/loader_paths.rb +137 -0
- data/lib/puppet/pops/loader/module_loaders.rb +242 -0
- data/lib/puppet/pops/loader/null_loader.rb +44 -0
- data/lib/puppet/pops/loader/ruby_function_instantiator.rb +34 -0
- data/lib/puppet/pops/loader/ruby_legacy_function_instantiator.rb +109 -0
- data/lib/puppet/pops/loader/simple_environment_loader.rb +20 -0
- data/lib/puppet/pops/loader/static_loader.rb +69 -0
- data/lib/puppet/pops/loader/uri_helper.rb +22 -0
- data/lib/puppet/pops/loaders.rb +240 -0
- data/lib/puppet/pops/model/factory.rb +13 -5
- data/lib/puppet/pops/model/model_tree_dumper.rb +12 -4
- data/lib/puppet/pops/parser/egrammar.ra +31 -18
- data/lib/puppet/pops/parser/eparser.rb +1137 -1106
- data/lib/puppet/pops/parser/lexer2.rb +17 -16
- data/lib/puppet/pops/semantic_error.rb +17 -0
- data/lib/puppet/pops/types/type_calculator.rb +150 -15
- data/lib/puppet/pops/types/type_factory.rb +69 -0
- data/lib/puppet/pops/types/type_parser.rb +9 -0
- data/lib/puppet/pops/types/types.rb +65 -4
- data/lib/puppet/pops/validation/checker4_0.rb +1 -1
- data/lib/puppet/pops/validation/validator_factory_4_0.rb +1 -1
- data/lib/puppet/property/list.rb +1 -1
- data/lib/puppet/provider/augeas/augeas.rb +2 -2
- data/lib/puppet/provider/cron/crontab.rb +13 -2
- data/lib/puppet/provider/package.rb +24 -0
- data/lib/puppet/provider/package/apt.rb +6 -1
- data/lib/puppet/provider/package/gem.rb +8 -2
- data/lib/puppet/provider/package/msi.rb +0 -15
- data/lib/puppet/provider/package/openbsd.rb +0 -24
- data/lib/puppet/provider/package/rpm.rb +3 -29
- data/lib/puppet/provider/package/windows.rb +0 -15
- data/lib/puppet/provider/package/yum.rb +101 -24
- data/lib/puppet/provider/package/yumhelper.py +31 -1
- data/lib/puppet/provider/package/zypper.rb +10 -28
- data/lib/puppet/provider/service/debian.rb +1 -1
- data/lib/puppet/provider/service/init.rb +3 -0
- data/lib/puppet/provider/service/openbsd.rb +318 -0
- data/lib/puppet/provider/service/redhat.rb +6 -3
- data/lib/puppet/provider/service/systemd.rb +2 -2
- data/lib/puppet/provider/yumrepo/inifile.rb +115 -42
- data/lib/puppet/resource.rb +13 -9
- data/lib/puppet/resource/catalog.rb +12 -6
- data/lib/puppet/resource/type_collection.rb +3 -3
- data/lib/puppet/settings.rb +57 -36
- data/lib/puppet/settings/config_file.rb +5 -0
- data/lib/puppet/settings/environment_conf.rb +147 -0
- data/lib/puppet/settings/ttl_setting.rb +48 -0
- data/lib/puppet/ssl/certificate_authority.rb +2 -3
- data/lib/puppet/ssl/certificate_authority/autosign_command.rb +1 -1
- data/lib/puppet/ssl/certificate_request.rb +4 -4
- data/lib/puppet/ssl/validator/default_validator.rb +2 -2
- data/lib/puppet/status.rb +1 -1
- data/lib/puppet/test/test_helper.rb +1 -0
- data/lib/puppet/type/augeas.rb +13 -1
- data/lib/puppet/type/cron.rb +32 -18
- data/lib/puppet/type/file.rb +4 -2
- data/lib/puppet/type/file/checksum.rb +15 -5
- data/lib/puppet/type/file/content.rb +3 -1
- data/lib/puppet/type/file/source.rb +5 -5
- data/lib/puppet/type/package.rb +12 -17
- data/lib/puppet/type/resources.rb +3 -1
- data/lib/puppet/type/scheduled_task.rb +4 -5
- data/lib/puppet/type/service.rb +12 -2
- data/lib/puppet/type/user.rb +106 -0
- data/lib/puppet/type/yumrepo.rb +9 -1
- data/lib/puppet/util/checksums.rb +60 -1
- data/lib/puppet/util/diff.rb +3 -1
- data/lib/puppet/util/execution.rb +20 -16
- data/lib/puppet/util/feature.rb +3 -0
- data/lib/puppet/util/logging.rb +19 -12
- data/lib/puppet/util/rubygems.rb +10 -0
- data/lib/puppet/util/watched_file.rb +1 -1
- data/lib/puppet/util/windows/security.rb +5 -3
- data/lib/puppet/vendor/load_semantic.rb +1 -0
- data/lib/puppet/vendor/require_vendored.rb +2 -0
- data/lib/puppet/vendor/semantic/Gemfile +20 -0
- data/lib/puppet/vendor/semantic/Rakefile +69 -0
- data/lib/puppet/vendor/semantic/lib/semantic.rb +7 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency.rb +181 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/graph.rb +60 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/graph_node.rb +117 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/module_release.rb +46 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/source.rb +25 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/unsatisfiable_graph.rb +31 -0
- data/lib/puppet/vendor/semantic/lib/semantic/version.rb +168 -0
- data/lib/puppet/vendor/semantic/lib/semantic/version_range.rb +424 -0
- data/lib/puppet/vendor/semantic/spec/spec_helper.rb +24 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/graph_node_spec.rb +141 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/graph_spec.rb +162 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/module_release_spec.rb +143 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/source_spec.rb +5 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/unsatisfiable_graph_spec.rb +44 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency_spec.rb +383 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/version_range_spec.rb +307 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/version_spec.rb +608 -0
- data/lib/puppet/version.rb +1 -1
- data/spec/fixtures/java.tgz +0 -0
- data/spec/fixtures/stdlib.tgz +0 -0
- data/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/usee/lib/puppet/functions/usee/callee.rb +5 -0
- data/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/user/lib/puppet/functions/user/caller.rb +5 -0
- data/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/user/metadata.json +9 -0
- data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/lib/puppet/functions/modulea/rb_func_a.rb +5 -0
- data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/lib/puppet/functions/rb_func_a.rb +5 -0
- data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/manifests/init.pp +3 -0
- data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/metadata.json +19 -0
- data/spec/fixtures/unit/pops/loaders/loaders/wo_metadata_module/modules/moduleb/lib/puppet/functions/moduleb/rb_func_b.rb +6 -0
- data/spec/fixtures/unit/pops/loaders/loaders/wo_metadata_module/modules/moduleb/manifests/init.pp +3 -0
- data/spec/fixtures/unit/provider/naginator/define_empty_param +6 -0
- data/spec/fixtures/unit/provider/service/systemd/list_unit_files_services +7 -0
- data/spec/fixtures/unit/type/user/authorized_keys +5 -0
- data/spec/integration/application/apply_spec.rb +1 -2
- data/spec/integration/configurer_spec.rb +2 -2
- data/spec/integration/faces/plugin_spec.rb +62 -0
- data/spec/integration/indirector/catalog/compiler_spec.rb +1 -1
- data/spec/integration/indirector/catalog/queue_spec.rb +1 -1
- data/spec/integration/node/environment_spec.rb +2 -2
- data/spec/integration/parser/future_compiler_spec.rb +96 -142
- data/spec/integration/parser/ruby_manifest_spec.rb +0 -5
- data/spec/integration/provider/cron/crontab_spec.rb +35 -0
- data/spec/integration/type/file_spec.rb +74 -72
- data/spec/integration/util/windows/security_spec.rb +17 -0
- data/spec/lib/matchers/resource.rb +45 -13
- data/spec/lib/puppet_spec/files.rb +18 -0
- data/spec/lib/puppet_spec/module_tool/shared_functions.rb +56 -0
- data/spec/lib/puppet_spec/module_tool/stub_source.rb +133 -0
- data/spec/shared_contexts/checksums.rb +55 -0
- data/spec/unit/application/apply_spec.rb +10 -7
- data/spec/unit/application/doc_spec.rb +17 -10
- data/spec/unit/application/indirection_base_spec.rb +18 -10
- data/spec/unit/application/inspect_spec.rb +22 -20
- data/spec/unit/configurer/downloader_spec.rb +7 -6
- data/spec/unit/configurer/plugin_handler_spec.rb +5 -8
- data/spec/unit/configurer_spec.rb +1 -1
- data/spec/unit/context_spec.rb +23 -0
- data/spec/unit/environments_spec.rb +274 -16
- data/spec/unit/face/config_spec.rb +111 -11
- data/spec/unit/face/module/install_spec.rb +14 -85
- data/spec/unit/face/module/list_spec.rb +108 -62
- data/spec/unit/face/module/search_spec.rb +1 -1
- data/spec/unit/face/module/uninstall_spec.rb +21 -42
- data/spec/unit/face/parser_spec.rb +5 -2
- data/spec/unit/file_bucket/dipper_spec.rb +92 -86
- data/spec/unit/file_bucket/file_spec.rb +23 -75
- data/spec/unit/file_serving/metadata_spec.rb +74 -74
- data/spec/unit/forge/module_release_spec.rb +131 -0
- data/spec/unit/forge/repository_spec.rb +21 -20
- data/spec/unit/forge_spec.rb +99 -23
- data/spec/unit/functions/assert_type_spec.rb +59 -0
- data/spec/unit/functions4_spec.rb +671 -0
- data/spec/unit/indirector/catalog/static_compiler_spec.rb +2 -2
- data/spec/unit/indirector/facts/facter_spec.rb +9 -3
- data/spec/unit/indirector/file_bucket_file/file_spec.rb +156 -155
- data/spec/unit/indirector/rest_spec.rb +8 -0
- data/spec/unit/interface/face_collection_spec.rb +35 -23
- data/spec/unit/module_spec.rb +20 -8
- data/spec/unit/module_tool/applications/builder_spec.rb +40 -12
- data/spec/unit/module_tool/applications/checksummer_spec.rb +86 -105
- data/spec/unit/module_tool/applications/installer_spec.rb +293 -261
- data/spec/unit/module_tool/applications/searcher_spec.rb +1 -1
- data/spec/unit/module_tool/applications/uninstaller_spec.rb +90 -154
- data/spec/unit/module_tool/applications/unpacker_spec.rb +12 -12
- data/spec/unit/module_tool/applications/upgrader_spec.rb +286 -18
- data/spec/unit/module_tool/metadata_spec.rb +223 -14
- data/spec/unit/module_tool/tar/gnu_spec.rb +12 -9
- data/spec/unit/module_tool/tar/mini_spec.rb +1 -1
- data/spec/unit/module_tool/tar_spec.rb +4 -18
- data/spec/unit/module_tool_spec.rb +123 -27
- data/spec/unit/network/formats_spec.rb +2 -2
- data/spec/unit/network/http_pool_spec.rb +21 -0
- data/spec/unit/network/rights_spec.rb +10 -8
- data/spec/unit/node/environment_spec.rb +27 -2
- data/spec/unit/parser/collector_spec.rb +1 -1
- data/spec/unit/parser/compiler_spec.rb +1 -1
- data/spec/unit/parser/functions/generate_spec.rb +4 -0
- data/spec/unit/pops/evaluator/access_ops_spec.rb +50 -11
- data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +25 -0
- data/spec/unit/pops/loaders/dependency_loader_spec.rb +44 -0
- data/spec/unit/pops/loaders/loader_paths_spec.rb +66 -0
- data/spec/unit/pops/loaders/loaders_spec.rb +105 -0
- data/spec/unit/pops/loaders/module_loaders_spec.rb +119 -0
- data/spec/unit/pops/loaders/static_loader_spec.rb +46 -0
- data/spec/unit/pops/types/type_calculator_spec.rb +145 -10
- data/spec/unit/pops/types/type_factory_spec.rb +101 -0
- data/spec/unit/pops/types/type_parser_spec.rb +22 -0
- data/spec/unit/property/list_spec.rb +9 -1
- data/spec/unit/provider/augeas/augeas_spec.rb +58 -11
- data/spec/unit/provider/cron/crontab_spec.rb +1 -0
- data/spec/unit/provider/cron/parsed_spec.rb +15 -0
- data/spec/unit/provider/naginator_spec.rb +14 -0
- data/spec/unit/provider/package/apt_spec.rb +78 -64
- data/spec/unit/provider/package/gem_spec.rb +15 -0
- data/spec/unit/provider/package/rpm_spec.rb +6 -6
- data/spec/unit/provider/package/windows_spec.rb +1 -1
- data/spec/unit/provider/package/yum_spec.rb +199 -104
- data/spec/unit/provider/package/zypper_spec.rb +41 -15
- data/spec/unit/provider/service/openbsd_spec.rb +129 -22
- data/spec/unit/provider/service/redhat_spec.rb +18 -4
- data/spec/unit/provider/service/systemd_spec.rb +5 -9
- data/spec/unit/provider/service/upstart_spec.rb +1 -1
- data/spec/unit/provider/user/directoryservice_spec.rb +10 -0
- data/spec/unit/provider/yumrepo/inifile_spec.rb +171 -15
- data/spec/unit/resource/catalog_spec.rb +20 -104
- data/spec/unit/resource/type_collection_spec.rb +10 -9
- data/spec/unit/settings/config_file_spec.rb +29 -6
- data/spec/unit/settings/environment_conf_spec.rb +51 -0
- data/spec/unit/settings_spec.rb +97 -12
- data/spec/unit/ssl/certificate_authority_spec.rb +2 -0
- data/spec/unit/type/augeas_spec.rb +1 -1
- data/spec/unit/type/cron_spec.rb +6 -7
- data/spec/unit/type/file/checksum_spec.rb +6 -0
- data/spec/unit/type/file/content_spec.rb +277 -207
- data/spec/unit/type/file_spec.rb +9 -7
- data/spec/unit/type/user_spec.rb +106 -18
- data/spec/unit/type/yumrepo_spec.rb +8 -0
- data/spec/unit/util/checksums_spec.rb +12 -5
- data/spec/unit/util/diff_spec.rb +8 -0
- data/spec/unit/util/execution_spec.rb +4 -4
- data/spec/unit/util/feature_spec.rb +2 -0
- data/spec/unit/util/logging_spec.rb +14 -4
- data/spec/unit/util/rdoc/parser_spec.rb +5 -4
- data/spec/unit/util/rubygems_spec.rb +14 -0
- data/tasks/parallel.rake +2 -2
- metadata +154 -21
- checksums.yaml +0 -7
- data/lib/puppet/module_tool/applications/generator.rb +0 -142
- data/lib/puppet/module_tool/skeleton.rb +0 -37
- data/lib/puppet/module_tool/skeleton/templates/generator/Modulefile.erb +0 -11
- data/lib/puppet/module_tool/skeleton/templates/generator/README.erb +0 -16
- data/lib/puppet/module_tool/tar/solaris.rb +0 -5
- data/spec/fixtures/unit/provider/service/systemd/list_units_services +0 -17
- data/spec/unit/module_tool/tar/solaris_spec.rb +0 -22
@@ -171,5 +171,106 @@ describe 'The type factory' do
|
|
171
171
|
t.size_type.from.should == 1
|
172
172
|
t.size_type.to.should == 2
|
173
173
|
end
|
174
|
+
|
175
|
+
context 'callable types' do
|
176
|
+
it 'the callable methods produces a Callable' do
|
177
|
+
t = Puppet::Pops::Types::TypeFactory.callable()
|
178
|
+
expect(t.class).to be(Puppet::Pops::Types::PCallableType)
|
179
|
+
expect(t.param_types.class).to be(Puppet::Pops::Types::PTupleType)
|
180
|
+
expect(t.param_types.types).to be_empty
|
181
|
+
expect(t.block_type).to be_nil
|
182
|
+
end
|
183
|
+
|
184
|
+
it 'callable method with types produces the corresponding Tuple for parameters and generated names' do
|
185
|
+
tf = Puppet::Pops::Types::TypeFactory
|
186
|
+
t = tf.callable(tf.integer, tf.string)
|
187
|
+
expect(t.class).to be(Puppet::Pops::Types::PCallableType)
|
188
|
+
expect(t.param_types.class).to be(Puppet::Pops::Types::PTupleType)
|
189
|
+
expect(t.param_types.types).to eql([tf.integer, tf.string])
|
190
|
+
expect(t.block_type).to be_nil
|
191
|
+
end
|
192
|
+
|
193
|
+
it 'callable accepts min range to be given' do
|
194
|
+
tf = Puppet::Pops::Types::TypeFactory
|
195
|
+
t = tf.callable(tf.integer, tf.string, 1)
|
196
|
+
expect(t.class).to be(Puppet::Pops::Types::PCallableType)
|
197
|
+
expect(t.param_types.class).to be(Puppet::Pops::Types::PTupleType)
|
198
|
+
expect(t.param_types.size_type.from).to eql(1)
|
199
|
+
expect(t.param_types.size_type.to).to be_nil
|
200
|
+
end
|
201
|
+
|
202
|
+
it 'callable accepts max range to be given' do
|
203
|
+
tf = Puppet::Pops::Types::TypeFactory
|
204
|
+
t = tf.callable(tf.integer, tf.string, 1, 3)
|
205
|
+
expect(t.class).to be(Puppet::Pops::Types::PCallableType)
|
206
|
+
expect(t.param_types.class).to be(Puppet::Pops::Types::PTupleType)
|
207
|
+
expect(t.param_types.size_type.from).to eql(1)
|
208
|
+
expect(t.param_types.size_type.to).to eql(3)
|
209
|
+
end
|
210
|
+
|
211
|
+
it 'callable accepts max range to be given as :default' do
|
212
|
+
tf = Puppet::Pops::Types::TypeFactory
|
213
|
+
t = tf.callable(tf.integer, tf.string, 1, :default)
|
214
|
+
expect(t.class).to be(Puppet::Pops::Types::PCallableType)
|
215
|
+
expect(t.param_types.class).to be(Puppet::Pops::Types::PTupleType)
|
216
|
+
expect(t.param_types.size_type.from).to eql(1)
|
217
|
+
expect(t.param_types.size_type.to).to be_nil
|
218
|
+
end
|
219
|
+
|
220
|
+
it 'the all_callables method produces a Callable matching any Callable' do
|
221
|
+
t = Puppet::Pops::Types::TypeFactory.all_callables()
|
222
|
+
expect(t.class).to be(Puppet::Pops::Types::PCallableType)
|
223
|
+
expect(t.param_types).to be_nil
|
224
|
+
expect(t.block_type).to be_nil
|
225
|
+
end
|
226
|
+
|
227
|
+
it 'with block are created by placing a Callable last' do
|
228
|
+
block_t = Puppet::Pops::Types::TypeFactory.callable(String)
|
229
|
+
t = Puppet::Pops::Types::TypeFactory.callable(String, block_t)
|
230
|
+
expect(t.block_type).to be(block_t)
|
231
|
+
end
|
232
|
+
|
233
|
+
it 'min size constraint can be used with a block last' do
|
234
|
+
block_t = Puppet::Pops::Types::TypeFactory.callable(String)
|
235
|
+
t = Puppet::Pops::Types::TypeFactory.callable(String, 1, block_t)
|
236
|
+
expect(t.block_type).to be(block_t)
|
237
|
+
expect(t.param_types.size_type.from).to eql(1)
|
238
|
+
expect(t.param_types.size_type.to).to be_nil
|
239
|
+
end
|
240
|
+
|
241
|
+
it 'min, max size constraint can be used with a block last' do
|
242
|
+
block_t = Puppet::Pops::Types::TypeFactory.callable(String)
|
243
|
+
t = Puppet::Pops::Types::TypeFactory.callable(String, 1, 3, block_t)
|
244
|
+
expect(t.block_type).to be(block_t)
|
245
|
+
expect(t.param_types.size_type.from).to eql(1)
|
246
|
+
expect(t.param_types.size_type.to).to eql(3)
|
247
|
+
end
|
248
|
+
|
249
|
+
it 'the with_block methods decorates a Callable with a block_type' do
|
250
|
+
t = Puppet::Pops::Types::TypeFactory.callable()
|
251
|
+
t2 = Puppet::Pops::Types::TypeFactory.with_block(t)
|
252
|
+
block_t = t2.block_type
|
253
|
+
# given t is returned after mutation
|
254
|
+
expect(t2).to be(t)
|
255
|
+
expect(block_t.class).to be(Puppet::Pops::Types::PCallableType)
|
256
|
+
expect(block_t.param_types.class).to be(Puppet::Pops::Types::PTupleType)
|
257
|
+
expect(block_t.param_types.types).to be_empty
|
258
|
+
expect(block_t.block_type).to be_nil
|
259
|
+
end
|
260
|
+
|
261
|
+
it 'the with_optional_block methods decorates a Callable with an optional block_type' do
|
262
|
+
t = Puppet::Pops::Types::TypeFactory.callable()
|
263
|
+
t2 = Puppet::Pops::Types::TypeFactory.with_optional_block(t)
|
264
|
+
opt_t = t2.block_type
|
265
|
+
expect(opt_t.class).to be(Puppet::Pops::Types::POptionalType)
|
266
|
+
block_t = opt_t.optional_type
|
267
|
+
# given t is returned after mutation
|
268
|
+
expect(t2).to be(t)
|
269
|
+
expect(block_t.class).to be(Puppet::Pops::Types::PCallableType)
|
270
|
+
expect(block_t.param_types.class).to be(Puppet::Pops::Types::PTupleType)
|
271
|
+
expect(block_t.param_types.types).to be_empty
|
272
|
+
expect(block_t.block_type).to be_nil
|
273
|
+
end
|
274
|
+
end
|
174
275
|
end
|
175
276
|
end
|
@@ -162,6 +162,28 @@ describe Puppet::Pops::Types::TypeParser do
|
|
162
162
|
expect(parser.parse("Ruby['Integer']")).to be_the_type(types.ruby_type('Integer'))
|
163
163
|
end
|
164
164
|
|
165
|
+
it 'parses a callable type' do
|
166
|
+
expect(parser.parse("Callable")).to be_the_type(types.all_callables())
|
167
|
+
end
|
168
|
+
|
169
|
+
it 'parses a parameterized callable type' do
|
170
|
+
expect(parser.parse("Callable[String, Integer]")).to be_the_type(types.callable(String, Integer))
|
171
|
+
end
|
172
|
+
|
173
|
+
it 'parses a parameterized callable type with min/max' do
|
174
|
+
expect(parser.parse("Callable[String, Integer, 1, default]")).to be_the_type(types.callable(String, Integer, 1, :default))
|
175
|
+
end
|
176
|
+
|
177
|
+
it 'parses a parameterized callable type with block' do
|
178
|
+
expect(parser.parse("Callable[String, Callable[Boolean]]")).to be_the_type(types.callable(String, types.callable(true)))
|
179
|
+
end
|
180
|
+
|
181
|
+
it 'parses a parameterized callable type with only min/max' do
|
182
|
+
t = parser.parse("Callable[0,0]")
|
183
|
+
expect(t).to be_the_type(types.callable())
|
184
|
+
expect(t.param_types.types).to be_empty
|
185
|
+
end
|
186
|
+
|
165
187
|
matcher :be_the_type do |type|
|
166
188
|
calc = Puppet::Pops::Types::TypeCalculator.new
|
167
189
|
|
@@ -93,9 +93,10 @@ describe list_class do
|
|
93
93
|
end
|
94
94
|
|
95
95
|
describe "when calling retrieve" do
|
96
|
+
let(:provider) { @provider }
|
96
97
|
before do
|
97
98
|
@provider = mock("provider")
|
98
|
-
@property.stubs(:provider).returns(
|
99
|
+
@property.stubs(:provider).returns(provider)
|
99
100
|
end
|
100
101
|
|
101
102
|
it "should send 'name' to the provider" do
|
@@ -115,6 +116,13 @@ describe list_class do
|
|
115
116
|
@property.stubs(:name).returns(:group)
|
116
117
|
@property.retrieve == :absent
|
117
118
|
end
|
119
|
+
|
120
|
+
context "and provider is nil" do
|
121
|
+
let(:provider) { nil }
|
122
|
+
it "should return :absent" do
|
123
|
+
@property.retrieve == :absent
|
124
|
+
end
|
125
|
+
end
|
118
126
|
end
|
119
127
|
|
120
128
|
describe "when calling safe_insync?" do
|
@@ -365,16 +365,56 @@ describe provider_class do
|
|
365
365
|
end
|
366
366
|
|
367
367
|
#Ticket 5211 testing
|
368
|
-
it "should return false when a size
|
368
|
+
it "should return false when a size does equal the provided value" do
|
369
369
|
@resource[:onlyif] = "match path size != 3"
|
370
370
|
@augeas.stubs("match").returns(["set", "of", "values"])
|
371
371
|
@provider.need_to_run?.should == false
|
372
372
|
end
|
373
373
|
|
374
|
+
[true, false].product([true, false]) do |cfg, param|
|
375
|
+
describe "and Puppet[:show_diff] is #{cfg} and show_diff => #{param}" do
|
376
|
+
let(:file) { "/some/random/file" }
|
377
|
+
|
378
|
+
before(:each) do
|
379
|
+
Puppet[:show_diff] = cfg
|
380
|
+
@resource[:show_diff] = param
|
381
|
+
|
382
|
+
@resource[:root] = ""
|
383
|
+
@resource[:context] = "/files"
|
384
|
+
@resource[:changes] = ["set #{file}/foo bar"]
|
385
|
+
|
386
|
+
File.stubs(:delete)
|
387
|
+
@provider.stubs(:get_augeas_version).returns("0.10.0")
|
388
|
+
@provider.stubs("diff").with("#{file}", "#{file}.augnew").returns("diff")
|
389
|
+
|
390
|
+
@augeas.stubs(:set).returns(true)
|
391
|
+
@augeas.stubs(:save).returns(true)
|
392
|
+
@augeas.stubs(:match).with("/augeas/events/saved").returns(["/augeas/events/saved"])
|
393
|
+
@augeas.stubs(:get).with("/augeas/events/saved").returns("/files#{file}")
|
394
|
+
@augeas.stubs(:set).with("/augeas/save", "newfile")
|
395
|
+
end
|
396
|
+
|
397
|
+
if cfg && param
|
398
|
+
it "should display a diff" do
|
399
|
+
@provider.should be_need_to_run
|
400
|
+
|
401
|
+
expect(@logs[0].message).to eq("\ndiff")
|
402
|
+
end
|
403
|
+
else
|
404
|
+
it "should not display a diff" do
|
405
|
+
@provider.should be_need_to_run
|
406
|
+
|
407
|
+
@logs.should be_empty
|
408
|
+
end
|
409
|
+
end
|
410
|
+
end
|
411
|
+
end
|
412
|
+
|
374
413
|
# Ticket 2728 (diff files)
|
375
|
-
describe "and
|
414
|
+
describe "and configured to show diffs" do
|
376
415
|
before(:each) do
|
377
416
|
Puppet[:show_diff] = true
|
417
|
+
@resource[:show_diff] = true
|
378
418
|
|
379
419
|
@resource[:root] = ""
|
380
420
|
@provider.stubs(:get_augeas_version).returns("0.10.0")
|
@@ -382,23 +422,26 @@ describe provider_class do
|
|
382
422
|
@augeas.stubs(:save).returns(true)
|
383
423
|
end
|
384
424
|
|
385
|
-
it "should
|
425
|
+
it "should display a diff when a single file is shown to have been changed" do
|
386
426
|
file = "/etc/hosts"
|
387
427
|
File.stubs(:delete)
|
388
428
|
|
429
|
+
@resource[:loglevel] = "crit"
|
389
430
|
@resource[:context] = "/files"
|
390
431
|
@resource[:changes] = ["set #{file}/foo bar"]
|
391
432
|
|
392
433
|
@augeas.stubs(:match).with("/augeas/events/saved").returns(["/augeas/events/saved"])
|
393
434
|
@augeas.stubs(:get).with("/augeas/events/saved").returns("/files#{file}")
|
394
435
|
@augeas.expects(:set).with("/augeas/save", "newfile")
|
395
|
-
@
|
436
|
+
@provider.expects("diff").with("#{file}", "#{file}.augnew").returns("diff")
|
396
437
|
|
397
|
-
@provider.expects("diff").with("#{file}", "#{file}.augnew").returns("")
|
398
438
|
@provider.should be_need_to_run
|
439
|
+
|
440
|
+
expect(@logs[0].message).to eq("\ndiff")
|
441
|
+
expect(@logs[0].level).to eq(:crit)
|
399
442
|
end
|
400
443
|
|
401
|
-
it "should
|
444
|
+
it "should display a diff for each file that is changed when changing many files" do
|
402
445
|
file1 = "/etc/hosts"
|
403
446
|
file2 = "/etc/resolv.conf"
|
404
447
|
File.stubs(:delete)
|
@@ -410,11 +453,13 @@ describe provider_class do
|
|
410
453
|
@augeas.stubs(:get).with("/augeas/events/saved[1]").returns("/files#{file1}")
|
411
454
|
@augeas.stubs(:get).with("/augeas/events/saved[2]").returns("/files#{file2}")
|
412
455
|
@augeas.expects(:set).with("/augeas/save", "newfile")
|
413
|
-
@
|
456
|
+
@provider.expects(:diff).with("#{file1}", "#{file1}.augnew").returns("diff #{file1}")
|
457
|
+
@provider.expects(:diff).with("#{file2}", "#{file2}.augnew").returns("diff #{file2}")
|
414
458
|
|
415
|
-
@provider.expects(:diff).with("#{file1}", "#{file1}.augnew").returns("")
|
416
|
-
@provider.expects(:diff).with("#{file2}", "#{file2}.augnew").returns("")
|
417
459
|
@provider.should be_need_to_run
|
460
|
+
|
461
|
+
expect(@logs.collect(&:message)).to include("\ndiff #{file1}", "\ndiff #{file2}")
|
462
|
+
expect(@logs.collect(&:level)).to eq([:notice, :notice])
|
418
463
|
end
|
419
464
|
|
420
465
|
describe "and resource[:root] is set" do
|
@@ -430,10 +475,12 @@ describe provider_class do
|
|
430
475
|
@augeas.stubs(:match).with("/augeas/events/saved").returns(["/augeas/events/saved"])
|
431
476
|
@augeas.stubs(:get).with("/augeas/events/saved").returns("/files#{file}")
|
432
477
|
@augeas.expects(:set).with("/augeas/save", "newfile")
|
433
|
-
@
|
478
|
+
@provider.expects(:diff).with("#{root}#{file}", "#{root}#{file}.augnew").returns("diff")
|
434
479
|
|
435
|
-
@provider.expects(:diff).with("#{root}#{file}", "#{root}#{file}.augnew").returns("")
|
436
480
|
@provider.should be_need_to_run
|
481
|
+
|
482
|
+
expect(@logs[0].message).to eq("\ndiff")
|
483
|
+
expect(@logs[0].level).to eq(:notice)
|
437
484
|
end
|
438
485
|
end
|
439
486
|
|
@@ -31,6 +31,14 @@ describe Puppet::Type.type(:cron).provider(:crontab) do
|
|
31
31
|
)
|
32
32
|
end
|
33
33
|
|
34
|
+
let :resource_sparse do
|
35
|
+
Puppet::Type.type(:cron).new(
|
36
|
+
:minute => %w{42},
|
37
|
+
:target => 'root',
|
38
|
+
:name => 'sparse'
|
39
|
+
)
|
40
|
+
end
|
41
|
+
|
34
42
|
let :record_special do
|
35
43
|
{
|
36
44
|
:record_type => :crontab,
|
@@ -317,5 +325,12 @@ describe Puppet::Type.type(:cron).provider(:crontab) do
|
|
317
325
|
end
|
318
326
|
end
|
319
327
|
end
|
328
|
+
|
329
|
+
describe "with a resource without a command" do
|
330
|
+
it "should not raise an error" do
|
331
|
+
expect { described_class.match(record,{resource_sparse[:name] => resource_sparse}) }.to_not raise_error
|
332
|
+
end
|
333
|
+
end
|
334
|
+
|
320
335
|
end
|
321
336
|
end
|
@@ -63,3 +63,17 @@ describe Nagios::Base do
|
|
63
63
|
obj.host_name.should == "my_hostname"
|
64
64
|
end
|
65
65
|
end
|
66
|
+
|
67
|
+
describe Nagios::Parser do
|
68
|
+
include PuppetSpec::Files
|
69
|
+
|
70
|
+
subject do
|
71
|
+
described_class.new
|
72
|
+
end
|
73
|
+
|
74
|
+
let(:config) { File.new( my_fixture('define_empty_param') ).read }
|
75
|
+
|
76
|
+
it "should handle empty parameter values" do
|
77
|
+
expect { subject.parse(config) }.to_not raise_error
|
78
|
+
end
|
79
|
+
end
|
@@ -1,44 +1,46 @@
|
|
1
1
|
#! /usr/bin/env ruby
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
describe
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
4
|
+
provider_class = Puppet::Type.type(:package).provider(:apt)
|
5
|
+
|
6
|
+
describe provider_class do
|
7
|
+
let(:name) { 'asdf' }
|
8
|
+
|
9
|
+
let(:resource) do
|
10
|
+
Puppet::Type.type(:package).new(
|
11
|
+
:name => name,
|
12
|
+
:provider => 'apt'
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
let(:provider) do
|
17
|
+
provider = provider_class.new
|
18
|
+
provider.resource = resource
|
19
|
+
provider
|
16
20
|
end
|
17
21
|
|
18
22
|
it "should be versionable" do
|
19
|
-
|
23
|
+
provider_class.should be_versionable
|
20
24
|
end
|
21
25
|
|
22
26
|
it "should use :install to update" do
|
23
|
-
|
24
|
-
|
27
|
+
provider.expects(:install)
|
28
|
+
provider.update
|
25
29
|
end
|
26
30
|
|
27
31
|
it "should use 'apt-get remove' to uninstall" do
|
28
|
-
|
29
|
-
|
30
|
-
@provider.uninstall
|
32
|
+
provider.expects(:aptget).with("-y", "-q", :remove, name)
|
33
|
+
provider.uninstall
|
31
34
|
end
|
32
35
|
|
33
36
|
it "should use 'apt-get purge' and 'dpkg purge' to purge" do
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
@provider.purge
|
37
|
+
provider.expects(:aptget).with("-y", "-q", :remove, "--purge", name)
|
38
|
+
provider.expects(:dpkg).with("--purge", name)
|
39
|
+
provider.purge
|
38
40
|
end
|
39
41
|
|
40
42
|
it "should use 'apt-cache policy' to determine the latest version of a package" do
|
41
|
-
|
43
|
+
provider.expects(:aptcache).with(:policy, name).returns "#{name}:
|
42
44
|
Installed: 1:1.0
|
43
45
|
Candidate: 1:1.1
|
44
46
|
Version table:
|
@@ -47,100 +49,112 @@ Version table:
|
|
47
49
|
*** 1:1.1
|
48
50
|
100 /var/lib/dpkg/status"
|
49
51
|
|
50
|
-
|
52
|
+
provider.latest.should == "1:1.1"
|
51
53
|
end
|
52
54
|
|
53
55
|
it "should print and error and return nil if no policy is found" do
|
54
|
-
|
56
|
+
provider.expects(:aptcache).with(:policy, name).returns "#{name}:"
|
55
57
|
|
56
|
-
|
57
|
-
|
58
|
+
provider.expects(:err)
|
59
|
+
provider.latest.should be_nil
|
58
60
|
end
|
59
61
|
|
60
62
|
it "should be able to preseed" do
|
61
|
-
|
63
|
+
provider.should respond_to(:run_preseed)
|
62
64
|
end
|
63
65
|
|
64
66
|
it "should preseed with the provided responsefile when preseeding is called for" do
|
65
|
-
|
66
|
-
Puppet::FileSystem.expects(:exist?).with(
|
67
|
+
resource[:responsefile] = '/my/file'
|
68
|
+
Puppet::FileSystem.expects(:exist?).with('/my/file').returns true
|
67
69
|
|
68
|
-
|
69
|
-
|
70
|
+
provider.expects(:info)
|
71
|
+
provider.expects(:preseed).with('/my/file')
|
70
72
|
|
71
|
-
|
73
|
+
provider.run_preseed
|
72
74
|
end
|
73
75
|
|
74
76
|
it "should not preseed if no responsefile is provided" do
|
75
|
-
|
76
|
-
|
77
|
-
@provider.expects(:info)
|
78
|
-
@provider.expects(:preseed).never
|
77
|
+
provider.expects(:info)
|
78
|
+
provider.expects(:preseed).never
|
79
79
|
|
80
|
-
|
80
|
+
provider.run_preseed
|
81
81
|
end
|
82
82
|
|
83
83
|
describe "when installing" do
|
84
84
|
it "should preseed if a responsefile is provided" do
|
85
|
-
|
86
|
-
|
85
|
+
resource[:responsefile] = "/my/file"
|
86
|
+
provider.expects(:run_preseed)
|
87
87
|
|
88
|
-
|
89
|
-
|
88
|
+
provider.stubs(:aptget)
|
89
|
+
provider.install
|
90
90
|
end
|
91
91
|
|
92
92
|
it "should check for a cdrom" do
|
93
|
-
|
93
|
+
provider.expects(:checkforcdrom)
|
94
94
|
|
95
|
-
|
96
|
-
|
95
|
+
provider.stubs(:aptget)
|
96
|
+
provider.install
|
97
97
|
end
|
98
98
|
|
99
99
|
it "should use 'apt-get install' with the package name if no version is asked for" do
|
100
|
-
|
101
|
-
|
100
|
+
resource[:ensure] = :installed
|
101
|
+
provider.expects(:aptget).with { |*command| command[-1] == name and command[-2] == :install }
|
102
102
|
|
103
|
-
|
103
|
+
provider.install
|
104
104
|
end
|
105
105
|
|
106
106
|
it "should specify the package version if one is asked for" do
|
107
|
-
|
108
|
-
|
107
|
+
resource[:ensure] = '1.0'
|
108
|
+
provider.expects(:aptget).with { |*command| command[-1] == "#{name}=1.0" }
|
109
109
|
|
110
|
-
|
110
|
+
provider.install
|
111
111
|
end
|
112
112
|
|
113
113
|
it "should use --force-yes if a package version is specified" do
|
114
|
-
|
115
|
-
|
114
|
+
resource[:ensure] = '1.0'
|
115
|
+
provider.expects(:aptget).with { |*command| command.include?("--force-yes") }
|
116
116
|
|
117
|
-
|
117
|
+
provider.install
|
118
118
|
end
|
119
119
|
|
120
120
|
it "should do a quiet install" do
|
121
|
-
|
121
|
+
provider.expects(:aptget).with { |*command| command.include?("-q") }
|
122
122
|
|
123
|
-
|
123
|
+
provider.install
|
124
124
|
end
|
125
125
|
|
126
126
|
it "should default to 'yes' for all questions" do
|
127
|
-
|
127
|
+
provider.expects(:aptget).with { |*command| command.include?("-y") }
|
128
128
|
|
129
|
-
|
129
|
+
provider.install
|
130
130
|
end
|
131
131
|
|
132
132
|
it "should keep config files if asked" do
|
133
|
-
|
134
|
-
|
133
|
+
resource[:configfiles] = :keep
|
134
|
+
provider.expects(:aptget).with { |*command| command.include?("DPkg::Options::=--force-confold") }
|
135
135
|
|
136
|
-
|
136
|
+
provider.install
|
137
137
|
end
|
138
138
|
|
139
139
|
it "should replace config files if asked" do
|
140
|
-
|
141
|
-
|
140
|
+
resource[:configfiles] = :replace
|
141
|
+
provider.expects(:aptget).with { |*command| command.include?("DPkg::Options::=--force-confnew") }
|
142
|
+
|
143
|
+
provider.install
|
144
|
+
end
|
145
|
+
|
146
|
+
it 'should support string install options' do
|
147
|
+
resource[:install_options] = ['--foo', '--bar']
|
148
|
+
provider.expects(:aptget).with('-q', '-y', '-o', 'DPkg::Options::=--force-confold', '--foo', '--bar', :install, name)
|
149
|
+
|
150
|
+
provider.install
|
151
|
+
end
|
152
|
+
|
153
|
+
it 'should support hash install options' do
|
154
|
+
resource[:install_options] = ['--foo', { '--bar' => 'baz', '--baz' => 'foo' }]
|
155
|
+
provider.expects(:aptget).with('-q', '-y', '-o', 'DPkg::Options::=--force-confold', '--foo', '--bar=baz', '--baz=foo', :install, name)
|
142
156
|
|
143
|
-
|
157
|
+
provider.install
|
144
158
|
end
|
145
159
|
end
|
146
160
|
end
|