spec/port_spec.rb in ruby-nmap-0.7.0 vs spec/port_spec.rb in ruby-nmap-0.8.0
- old
+ new
@@ -2,37 +2,45 @@
require 'nmap/port'
describe Port do
subject { @xml.hosts.first.ports.first }
- it "should parse the protocol" do
- subject.protocol.should == :tcp
+ describe "#protocol" do
+ it "should parse the protocol" do
+ expect(subject.protocol).to eq(:tcp)
+ end
end
- it "should parse the port number" do
- subject.number.should == 22
+ describe "#number" do
+ it "should parse the port number" do
+ expect(subject.number).to eq(22)
+ end
end
- it "should parse the state" do
- subject.state.should == :open
+ describe "#state" do
+ it "should parse the state" do
+ expect(subject.state).to eq(:open)
+ end
end
- it "should parse the reason" do
- subject.reason.should == 'syn-ack'
+ describe "#reason" do
+ it "should parse the reason" do
+ expect(subject.reason).to eq('syn-ack')
+ end
end
describe "#service" do
subject { super().service }
it "should return a Service object" do
- subject.should be_kind_of(Service)
+ expect(subject).to be_kind_of(Service)
end
end
include_examples "#scripts"
describe "#inspect" do
it "should include the number" do
- subject.inspect.should include(subject.number.to_s)
+ expect(subject.inspect).to include(subject.number.to_s)
end
end
end