Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
099b7c4
commit 469e886
Showing
7 changed files
with
35 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env rspec | ||
|
||
require_relative "test_helper" | ||
require "yast" | ||
|
||
Yast.import "HttpServer" | ||
|
||
describe Yast::HttpServerRoutinesInclude do | ||
# it is included in http server module | ||
subject { Yast::HttpServer } | ||
|
||
describe "#listen2item" do | ||
it "returns Item with \"all addresses\" and port number for port number only" do | ||
expect(subject.listen2item("128", :first)).to eq Item(Id(:first), "All Addresses", "128") | ||
end | ||
|
||
it "returns Item with address and port number for adrress with port number" do | ||
expect(subject.listen2item("127.0.0.1:128", :first)).to eq Item(Id(:first), "127.0.0.1", "128") | ||
end | ||
|
||
it "return Item with id specified in second argument" do | ||
expect(subject.listen2item("127.0.0.1:128", :first)).to eq Item(Id(:first), "127.0.0.1", "128") | ||
end | ||
end | ||
|
||
describe "#listen2map" do | ||
it "returns hash with \"address\" \"all\" and port number for port number only" do | ||
expect(subject.listen2map("128")).to eq("port" => "128", "address" => "all") | ||
end | ||
|
||
it "returns hash with address and port number for address with port number" do | ||
expect(subject.listen2map("127.0.0.1:128")).to eq("port" => "128", "address" => "127.0.0.1") | ||
end | ||
end | ||
end |
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.