|
|
@ -8,6 +8,8 @@ describe LtnpOperator do
|
|
|
|
nonsense_port = "1234"
|
|
|
|
nonsense_port = "1234"
|
|
|
|
|
|
|
|
|
|
|
|
existing_p_name = "polymer"
|
|
|
|
existing_p_name = "polymer"
|
|
|
|
|
|
|
|
partial_existing_p_name = "poly"
|
|
|
|
|
|
|
|
multiple_exist_p_name = "spotify"
|
|
|
|
nonsense_p_name = "thisisnotathing"
|
|
|
|
nonsense_p_name = "thisisnotathing"
|
|
|
|
|
|
|
|
|
|
|
|
describe "#get_port_record" do
|
|
|
|
describe "#get_port_record" do
|
|
|
@ -22,11 +24,11 @@ describe LtnpOperator do
|
|
|
|
|
|
|
|
|
|
|
|
describe "#search_p_name" do
|
|
|
|
describe "#search_p_name" do
|
|
|
|
it "should find record when process exists" do
|
|
|
|
it "should find record when process exists" do
|
|
|
|
sut.search_p_name(existing_p_name).nil?.should be_false
|
|
|
|
sut.search_p_name(existing_p_name).empty?.should be_false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
it "should not find record when process doesn't exist" do
|
|
|
|
it "should not find record when process doesn't exist" do
|
|
|
|
sut.search_p_name(nonsense_p_name).nil?.should be_true
|
|
|
|
sut.search_p_name(nonsense_p_name).empty?.should be_true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -41,10 +43,18 @@ describe LtnpOperator do
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
describe "#find_process" do
|
|
|
|
describe "#find_process" do
|
|
|
|
it "should output successful message if found" do
|
|
|
|
it "should output successful message if full match found" do
|
|
|
|
sut.find_process(existing_p_name).should contain("Process:")
|
|
|
|
sut.find_process(existing_p_name).should contain("Process:")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "should output successful message if partial match found" do
|
|
|
|
|
|
|
|
sut.find_process(partial_existing_p_name).should contain("Process:")
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "should output every found process" do
|
|
|
|
|
|
|
|
sut.find_process(multiple_exist_p_name).each_line.size.should eq 2
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
it "should output failure message if not found" do
|
|
|
|
it "should output failure message if not found" do
|
|
|
|
sut.find_process(nonsense_p_name).should contain("No")
|
|
|
|
sut.find_process(nonsense_p_name).should contain("No")
|
|
|
|
end
|
|
|
|
end
|
|
|
|