Skip to content

Commit

Permalink
Fix InterfacesTable test
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Sep 19, 2018
1 parent f90c64f commit 53a5cf5
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion test/lib/y2firewall/widgets/interfaces_table_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

let(:eth0) do
instance_double(
Y2Firewall::Firewalld::Interface, name: "eth0", device_name: DEVICE_NAME, zone: "public"
Y2Firewall::Firewalld::Interface, name: "eth0", device_name: DEVICE_NAME, zone: public_zone
)
end

Expand All @@ -43,6 +43,18 @@
)
end

let(:public_zone) do
instance_double(
Y2Firewall::Firewalld::Zone, name: "public", interfaces: [], remove_interface: nil
)
end

let(:dmz_zone) do
instance_double(
Y2Firewall::Firewalld::Zone, name: "dmz", remove_interface: nil
)
end

let(:interfaces) { [eth0, eth1] }

let(:change_zone_button) do
Expand All @@ -51,6 +63,10 @@

include_examples "CWM::Table"

before do
allow(public_zone).to receive(:interfaces).and_return([eth0])
end

describe "#items" do
it "returns the list of interfaces" do
expect(widget.items).to eq(
Expand Down

0 comments on commit 53a5cf5

Please sign in to comment.