diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/provider/route_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/unit/provider/route_spec.rb b/spec/unit/provider/route_spec.rb index 2beb765259..a9c7d91457 100644 --- a/spec/unit/provider/route_spec.rb +++ b/spec/unit/provider/route_spec.rb @@ -29,9 +29,14 @@ describe Chef::Provider::Route do @new_resource.gateway "10.0.0.9" @current_resource = Chef::Resource::Route.new("10.0.0.10") @current_resource.gateway "10.0.0.9" + @default_resource = Chef::Resource::Route.new("default") + @default_resource.gateway "10.0.0.9" @provider = Chef::Provider::Route.new(@new_resource, @run_context) @provider.current_resource = @current_resource + + @default_provider = Chef::Provider::Route.new(@default_resource, @run_context) + @default_provider.current_resource = @default_resource end describe Chef::Provider::Route, "hex2ip" do @@ -161,6 +166,11 @@ describe Chef::Provider::Route do @new_resource.gateway(nil) expect(@provider.generate_command(:add).join(" ")).not_to match(/\svia\s#{Regexp.escape(@new_resource.gateway.to_s)}/) end + + it "should use the gatway when target is default" do + @default_resource.gateway("10.0.0.10") + expect(@default_provider.generate_command(:add).join(" ")).to match(/10.0.0.10/) + end end describe Chef::Provider::Route, "generate_command for action_delete" do |