From 58c765f8cc6d7565fd6f6aee5843f0b9970bc313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Imobach=20Gonz=C3=A1lez=20Sosa?= Date: Mon, 2 Sep 2019 14:45:24 +0100 Subject: [PATCH] Drop FakeInterface class --- src/lib/y2network/fake_interface.rb | 38 ------------------ test/y2network/fake_interface_test.rb | 40 ------------------- .../connection_config_writers/vlan_test.rb | 1 - 3 files changed, 79 deletions(-) delete mode 100644 src/lib/y2network/fake_interface.rb delete mode 100644 test/y2network/fake_interface_test.rb diff --git a/src/lib/y2network/fake_interface.rb b/src/lib/y2network/fake_interface.rb deleted file mode 100644 index db1a914a1..000000000 --- a/src/lib/y2network/fake_interface.rb +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (c) [2019] SUSE LLC -# -# All Rights Reserved. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of version 2 of the GNU General Public License as published -# by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, contact SUSE LLC. -# -# To contact SUSE LLC about this file by physical or electronic mail, you may -# find current contact information at www.suse.com. - -require "y2network/interface" - -module Y2Network - # A physical interface that is not plugged in. - class FakeInterface < Interface - class << self - # Build connection - # - # @todo Would be possible to get the name from the connection? - # - # @param name [String] Interface name - # @param conn [ConnectionConfig] Connection configuration related to the - # network interface - def from_connection(name, conn) - new(name, type: conn.type) - end - end - end -end diff --git a/test/y2network/fake_interface_test.rb b/test/y2network/fake_interface_test.rb deleted file mode 100644 index 52fe98fdc..000000000 --- a/test/y2network/fake_interface_test.rb +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) [2019] SUSE LLC -# -# All Rights Reserved. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of version 2 of the GNU General Public License as published -# by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, contact SUSE LLC. -# -# To contact SUSE LLC about this file by physical or electronic mail, you may -# find current contact information at www.suse.com. -require_relative "../test_helper" -require "y2network/fake_interface" -require "y2network/connection_config/wireless" - -describe Y2Network::FakeInterface do - subject(:interface) { described_class.new("eth0", type: iface_type) } - - let(:iface_type) { Y2Network::InterfaceType::ETHERNET } - - describe ".from_connection" do - let(:conn) do - Y2Network::ConnectionConfig::Wireless.new.tap do |conn| - conn.interface = "wlan0" - end - end - - it "returns a fake interface using the connection's type" do - iface = described_class.from_connection("wlan0", conn) - expect(iface.type).to eq(Y2Network::InterfaceType::WIRELESS) - end - end -end diff --git a/test/y2network/sysconfig/connection_config_writers/vlan_test.rb b/test/y2network/sysconfig/connection_config_writers/vlan_test.rb index 4d46231fd..9010cf163 100644 --- a/test/y2network/sysconfig/connection_config_writers/vlan_test.rb +++ b/test/y2network/sysconfig/connection_config_writers/vlan_test.rb @@ -20,7 +20,6 @@ require_relative "../../../test_helper" require "y2network/sysconfig/connection_config_writers/vlan" -require "y2network/fake_interface" require "y2network/startmode" require "y2network/boot_protocol" require "y2network/connection_config/vlan"