Use a more descriptive subject
Also removes the unnecessary (and now broken in 2.0) checks for respond_to? on accessors.unstable
parent
0f2ea755c5
commit
5955397882
|
@ -4,7 +4,7 @@ require 'rex/post/meterpreter/packet_parser'
|
|||
|
||||
|
||||
describe Rex::Post::Meterpreter::PacketParser do
|
||||
subject{
|
||||
subject(:parser){
|
||||
Rex::Post::Meterpreter::PacketParser.new
|
||||
}
|
||||
before(:each) do
|
||||
|
@ -18,41 +18,17 @@ describe Rex::Post::Meterpreter::PacketParser do
|
|||
end
|
||||
end
|
||||
|
||||
it "should respond to cipher" do
|
||||
subject.should respond_to :cipher
|
||||
end
|
||||
|
||||
it "should respond to raw" do
|
||||
subject.should respond_to :raw
|
||||
end
|
||||
|
||||
it "should respond to reset" do
|
||||
subject.should respond_to :reset
|
||||
end
|
||||
|
||||
it "should respond to recv" do
|
||||
subject.should respond_to :recv
|
||||
end
|
||||
|
||||
it "should respond to hdr_length_left" do
|
||||
subject.should respond_to :hdr_length_left
|
||||
end
|
||||
|
||||
it "should respond to payload_length_left" do
|
||||
subject.should respond_to :payload_length_left
|
||||
end
|
||||
|
||||
it "should initialise with expected defaults" do
|
||||
subject.send(:raw).should == ""
|
||||
subject.send(:hdr_length_left).should == 8
|
||||
subject.send(:payload_length_left).should == 0
|
||||
parser.send(:raw).should == ""
|
||||
parser.send(:hdr_length_left).should == 8
|
||||
parser.send(:payload_length_left).should == 0
|
||||
end
|
||||
|
||||
it "should parse valid raw data into a packet object" do
|
||||
while @raw.length >0
|
||||
parsed_packet = subject.recv(@sock)
|
||||
parsed_packet = parser.recv(@sock)
|
||||
end
|
||||
parsed_packet.class.should == Rex::Post::Meterpreter::Packet
|
||||
parsed_packet.should be_a Rex::Post::Meterpreter::Packet
|
||||
parsed_packet.type.should == Rex::Post::Meterpreter::PACKET_TYPE_REQUEST
|
||||
parsed_packet.method?("test_method").should == true
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue