Skip to content

Commit

Permalink
convert listen2 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Feb 7, 2020
1 parent 099b7c4 commit 469e886
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 64 deletions.
35 changes: 35 additions & 0 deletions test/routines_test.rb
@@ -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 removed testsuite/tests/listen2item.err
Empty file.
3 changes: 0 additions & 3 deletions testsuite/tests/listen2item.out

This file was deleted.

29 changes: 0 additions & 29 deletions testsuite/tests/listen2item.rb

This file was deleted.

Empty file removed testsuite/tests/listen2map.err
Empty file.
3 changes: 0 additions & 3 deletions testsuite/tests/listen2map.out

This file was deleted.

29 changes: 0 additions & 29 deletions testsuite/tests/listen2map.rb

This file was deleted.

0 comments on commit 469e886

Please sign in to comment.