Skip to content

Commit

Permalink
Drop the unused NtpServer.load_from_file
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Feb 19, 2020
1 parent a76b203 commit 4d116b8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
10 changes: 0 additions & 10 deletions src/lib/y2network/ntp_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,6 @@ def default_servers(products = nil)

(0..DEFAULT_SERVERS - 1).map { |i| new("#{i}.#{host}.#{DEFAULT_SUBDOMAIN}") }
end

# Loads the list of servers from the given file
#
# @param path [String] File path
# @return [Array<NtpServer>] Array containing all the servers
def load_from_file(path)
YAML.load_file(path).map do |server|
new(server["address"], country: server["country"], location: server["location"])
end
end
end

# Constructor
Expand Down
10 changes: 0 additions & 10 deletions test/y2network/ntp_server_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,6 @@
end
end

describe "'.load_from_file" do
it "returns the list of servers from the file" do
servers = described_class.load_from_file(File.join(DATA_PATH, "ntp_servers.yml"))
server = servers.first
expect(server.hostname).to eq("ntp.cgi.cz")
expect(server.location).to eq("Czech Republic")
expect(server.country).to eq("CZ")
end
end

describe "#==" do
subject { Y2Network::NtpServer.new("suse.pool.ntp.org", country: "DE", location: "Germany") }

Expand Down

0 comments on commit 4d116b8

Please sign in to comment.