summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/chef/resource/route.rb2
-rw-r--r--spec/unit/resource/route_spec.rb9
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/chef/resource/route.rb b/lib/chef/resource/route.rb
index ee91ee2bc7..45a1266fd7 100644
--- a/lib/chef/resource/route.rb
+++ b/lib/chef/resource/route.rb
@@ -48,7 +48,7 @@ class Chef
description: "The network interface to which the route applies.",
desired_state: false # Has a partial default in the provider of eth0.
- property :route_type, Symbol,
+ property :route_type, [Symbol, String],
description: "",
equal_to: [:host, :net], default: :host, desired_state: false
end
diff --git a/spec/unit/resource/route_spec.rb b/spec/unit/resource/route_spec.rb
index d4248755b5..dd79d04024 100644
--- a/spec/unit/resource/route_spec.rb
+++ b/spec/unit/resource/route_spec.rb
@@ -56,8 +56,13 @@ describe Chef::Resource::Route do
expect(resource.device).to eql("eth0")
end
- it "allows you to specify the route type" do
- resource.route_type "host"
+ it "allows you to specify the route type as a symbol" do
+ resource.route_type :host
+ expect(resource.route_type).to eql(:host)
+ end
+
+ it "allows you to specify the route type as a string" do
+ resource.route_type :host
expect(resource.route_type).to eql(:host)
end