summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/chef/cookbook/metadata.rb2
-rw-r--r--spec/data/cookbooks/supports-platform-constraints/metadata.rb5
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/chef/cookbook/metadata.rb b/lib/chef/cookbook/metadata.rb
index e9509be38c..0892d85749 100644
--- a/lib/chef/cookbook/metadata.rb
+++ b/lib/chef/cookbook/metadata.rb
@@ -746,7 +746,7 @@ OBSOLETED
end
def validate_version_constraint(caller_name, dep_name, constraint_str)
- Chef::VersionConstraint.new(constraint_str)
+ Chef::VersionConstraint::Platform.new(constraint_str)
rescue Chef::Exceptions::InvalidVersionConstraint => e
Log.debug(e)
diff --git a/spec/data/cookbooks/supports-platform-constraints/metadata.rb b/spec/data/cookbooks/supports-platform-constraints/metadata.rb
new file mode 100644
index 0000000000..3620249d5f
--- /dev/null
+++ b/spec/data/cookbooks/supports-platform-constraints/metadata.rb
@@ -0,0 +1,5 @@
+name 'supports-platform-constraints'
+version '0.1.0'
+
+supports 'centos', '>= 6'
+supports 'freebsd', '> 10.1-fake-p12'