diff options
author | Tim Smith <tsmith@chef.io> | 2018-10-29 12:22:47 -0700 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2018-10-29 12:22:47 -0700 |
commit | b26dbf802daa488e14232a5a88bc49d23a4a64f7 (patch) | |
tree | 67d0108a6b0d18ca50ef88314bc886117837d53b | |
parent | a71493d575cb24fce33faf26e2530cdc45bcafe2 (diff) | |
download | chef-b26dbf802daa488e14232a5a88bc49d23a4a64f7.tar.gz |
Fix support for passing route type as a Stringroute_resource
Add a test for this as well so we don't break it again later.
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | lib/chef/resource/route.rb | 2 | ||||
-rw-r--r-- | spec/unit/resource/route_spec.rb | 9 |
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 |