diff options
author | Serdar Sutay <serdar@opscode.com> | 2014-10-10 12:40:45 -0700 |
---|---|---|
committer | Serdar Sutay <serdar@opscode.com> | 2014-10-10 12:40:45 -0700 |
commit | 18b555fb4dbf848ebfd274a5ceeda1b6a2427efd (patch) | |
tree | 58a3a3375214752472ad00d1ba4349dd086d2fe0 /spec/unit/cookbook | |
parent | fa6e449b9e01cb4c2c145c1dac6ff054910dc12d (diff) | |
parent | 56246eef11d1c578f2bc9dbc92259565964f03f3 (diff) | |
download | chef-18b555fb4dbf848ebfd274a5ceeda1b6a2427efd.tar.gz |
Merge pull request #2129 from JeanMertz/library_subfolders
[CHEF-672] load library folder recursively
Diffstat (limited to 'spec/unit/cookbook')
-rw-r--r-- | spec/unit/cookbook/cookbook_version_loader_spec.rb | 5 | ||||
-rw-r--r-- | spec/unit/cookbook/syntax_check_spec.rb | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/spec/unit/cookbook/cookbook_version_loader_spec.rb b/spec/unit/cookbook/cookbook_version_loader_spec.rb index 5772c5352d..4ba4e1de57 100644 --- a/spec/unit/cookbook/cookbook_version_loader_spec.rb +++ b/spec/unit/cookbook/cookbook_version_loader_spec.rb @@ -57,6 +57,11 @@ describe Chef::Cookbook::CookbookVersionLoader do expect(loaded_cookbook.recipe_filenames).to include(full_path("/recipes/return.rb")) end + it "loads libraries" do + expect(loaded_cookbook.library_filenames).to include(full_path('/libraries/openldap.rb')) + expect(loaded_cookbook.library_filenames).to include(full_path('/libraries/openldap/version.rb')) + end + it "loads static files in the files/ dir" do expect(loaded_cookbook.file_filenames).to include(full_path("/files/default/remotedir/remotesubdir/remote_subdir_file1.txt")) expect(loaded_cookbook.file_filenames).to include(full_path("/files/default/remotedir/remotesubdir/remote_subdir_file2.txt")) diff --git a/spec/unit/cookbook/syntax_check_spec.rb b/spec/unit/cookbook/syntax_check_spec.rb index cd1ce96716..4d22e0e920 100644 --- a/spec/unit/cookbook/syntax_check_spec.rb +++ b/spec/unit/cookbook/syntax_check_spec.rb @@ -28,10 +28,12 @@ describe Chef::Cookbook::SyntaxCheck do let(:syntax_check) { Chef::Cookbook::SyntaxCheck.new(cookbook_path) } let(:open_ldap_cookbook_files) do - %w{ attributes/default.rb + %w{ attributes/default.rb attributes/smokey.rb definitions/client.rb definitions/server.rb + libraries/openldap.rb + libraries/openldap/version.rb metadata.rb recipes/default.rb recipes/gigantor.rb @@ -44,9 +46,10 @@ describe Chef::Cookbook::SyntaxCheck do Chef::Log.level = :warn # suppress "Syntax OK" messages @attr_files = %w{default.rb smokey.rb}.map { |f| File.join(cookbook_path, 'attributes', f) } + @libr_files = %w{openldap.rb openldap/version.rb}.map { |f| File.join(cookbook_path, 'libraries', f) } @defn_files = %w{client.rb server.rb}.map { |f| File.join(cookbook_path, 'definitions', f)} @recipes = %w{default.rb gigantor.rb one.rb return.rb}.map { |f| File.join(cookbook_path, 'recipes', f) } - @ruby_files = @attr_files + @defn_files + @recipes + [File.join(cookbook_path, "metadata.rb")] + @ruby_files = @attr_files + @libr_files + @defn_files + @recipes + [File.join(cookbook_path, "metadata.rb")] basenames = %w{ helpers_via_partial_test.erb helper_test.erb openldap_stuff.conf.erb |