Skip to content

Commit

Permalink
Updated testsuite for automatic dhcp configuration in installer.
Browse files Browse the repository at this point in the history
  • Loading branch information
mchf committed Sep 5, 2016
1 parent b9a34ea commit d445a0b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/Makefile.am
Expand Up @@ -12,6 +12,7 @@ TESTS = \
hardware_test.rb \
host_test.rb \
ifroute_test.rb \
inst_setup_dhcp_test.rb \
install_inf_convertor_test.rb \
lan_items_export_test.rb \
lan_items_helpers_test.rb \
Expand Down
27 changes: 27 additions & 0 deletions test/inst_setup_dhcp_test.rb
@@ -0,0 +1,27 @@
#!/usr/bin/env rspec

require_relative "test_helper"

require "yast"
require "network/network_autoconfiguration"
require_relative "../src/clients/inst_setup_dhcp"

describe Yast::SetupDhcp do
describe "#main" do
it "returns :next when autoconfiguration is performed" do
allow(Yast::NetworkAutoconfiguration)
.to receive(:any_iface_active?)
.and_return(true)

expect(Yast::SetupDhcp.instance.main).to eql :next
end

it "returns :next when autoconfiguration is not performed" do
allow(Yast::NetworkAutoconfiguration)
.to receive(:any_iface_active?)
.and_return(false)

expect(Yast::SetupDhcp.instance.main).to eql :next
end
end
end

0 comments on commit d445a0b

Please sign in to comment.