From 4aaee228cec3df85018094350d95a90f62e774e4 Mon Sep 17 00:00:00 2001 From: Tom Doherty Date: Fri, 8 Sep 2017 18:31:19 +0100 Subject: Refactor and add an additional unit test Signed-off-by: Tom Doherty --- spec/unit/provider/route_spec.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'spec/unit/provider') diff --git a/spec/unit/provider/route_spec.rb b/spec/unit/provider/route_spec.rb index a9c7d91457..5e655bda0c 100644 --- a/spec/unit/provider/route_spec.rb +++ b/spec/unit/provider/route_spec.rb @@ -226,10 +226,20 @@ describe Chef::Provider::Route do route_file = StringIO.new expect(File).to receive(:new).with("/etc/sysconfig/network-scripts/route-eth0", "w").and_return(route_file) - # Chef::Log.should_receive(:debug).with("route[10.0.0.10] writing route.eth0\n10.0.0.10 via 10.0.0.9\n") @run_context.resource_collection << @new_resource @provider.generate_config end + + end + %w{ centos redhat fedora }.each do |platform| + it "should write a default route file on #{platform} platform" do + @node.automatic_attrs[:platform] = platform + + route_file = StringIO.new + expect(File).to receive(:new).with("/etc/sysconfig/network", "w").and_return(route_file) + @run_context.resource_collection << @default_resource + @default_provider.generate_config + end end it "should put all routes for a device in a route config file" do -- cgit v1.2.1