File tree Expand file tree Collapse file tree 1 file changed +34
-1
lines changed
spec/lib/rex/post/meterpreter Expand file tree Collapse file tree 1 file changed +34
-1
lines changed Original file line number Diff line number Diff line change 90
90
end
91
91
end
92
92
93
- end
93
+ context "A Method TLV" do
94
+ subject { Rex ::Post ::Meterpreter ::Tlv . new ( Rex ::Post ::Meterpreter ::TLV_TYPE_METHOD , "test" ) }
95
+ it "should return true when checked for a meta type of String" do
96
+ subject . meta_type? ( Rex ::Post ::Meterpreter ::TLV_META_TYPE_STRING ) . should == true
97
+ end
98
+
99
+ it "should show the correct type and meta type in inspect" do
100
+ tlv_to_s = "#<Rex::Post::Meterpreter::Tlv type=METHOD meta=STRING value=\" test\" >"
101
+ subject . inspect . should == tlv_to_s
102
+ end
103
+ end
104
+
105
+ context "A String TLV with a number value" do
106
+ subject { Rex ::Post ::Meterpreter ::Tlv . new ( Rex ::Post ::Meterpreter ::TLV_TYPE_STRING , 5 ) }
107
+ it "should return the string version of the number" do
108
+ subject . value . should == "5"
109
+ end
110
+ end
111
+
112
+ end
113
+
114
+ describe Rex ::Post ::Meterpreter ::GroupTlv do
115
+ subject { Rex ::Post ::Meterpreter ::GroupTlv . new ( Rex ::Post ::Meterpreter ::TLV_TYPE_CHANNEL_DATA_GROUP ) }
116
+
117
+ it "should respond to tlvs" do
118
+ subject . should respond_to :tlvs
119
+ end
120
+
121
+ it "should return an empty array for tlvs by default" do
122
+ subject . tlvs . should == [ ]
123
+ end
124
+
125
+
126
+ end
You can’t perform that action at this time.
0 commit comments