diff options
author | Tom Doherty <tom.doherty@fixnetix.com> | 2017-09-08 18:31:19 +0100 |
---|---|---|
committer | Tom Doherty <tom.doherty@fixnetix.com> | 2017-09-08 18:31:19 +0100 |
commit | 4aaee228cec3df85018094350d95a90f62e774e4 (patch) | |
tree | 458629752a7f73fe145328d8f97574e0461c1eae /spec/unit/provider | |
parent | d78b719df2a6ef127f7becb9b7b7be25a4260560 (diff) | |
download | chef-4aaee228cec3df85018094350d95a90f62e774e4.tar.gz |
Refactor and add an additional unit test
Signed-off-by: Tom Doherty <tom.doherty@fixnetix.com>
Diffstat (limited to 'spec/unit/provider')
-rw-r--r-- | spec/unit/provider/route_spec.rb | 12 |
1 files changed, 11 insertions, 1 deletions
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 |