summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/chef/cookbook/metadata.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/cookbook/metadata.rb b/lib/chef/cookbook/metadata.rb
index 4604a28e83..e9509be38c 100644
--- a/lib/chef/cookbook/metadata.rb
+++ b/lib/chef/cookbook/metadata.rb
@@ -404,7 +404,7 @@ class Chef
# @param version_args [Array<String>] Version constraint in String form
# @return [Array<Gem::Dependency>] Current chef_versions array
def chef_version(*version_args)
- @chef_versions << Gem::Dependency.new('chef', *version_args)
+ @chef_versions << Gem::Dependency.new('chef', *version_args) unless version_args.empty?
@chef_versions
end
@@ -415,7 +415,7 @@ class Chef
# @param version_args [Array<String>] Version constraint in String form
# @return [Array<Gem::Dependency>] Current ohai_versions array
def ohai_version(*version_args)
- @ohai_versions << Gem::Dependency.new('ohai', *version_args)
+ @ohai_versions << Gem::Dependency.new('ohai', *version_args) unless version_args.empty?
@ohai_versions
end