spec/scripts_examples.rb in ruby-nmap-0.8.0 vs spec/scripts_examples.rb in ruby-nmap-0.9.0
- old
+ new
@@ -4,7 +4,32 @@
describe "#scripts" do
subject { super().scripts }
it { is_expected.to be_kind_of(Hash) }
it { is_expected.not_to be_empty }
+
+ it "should contain String keys" do
+ expect(subject.keys).to all(be_kind_of(String))
+ end
+
+ it "should contain String values" do
+ expect(subject.values).to all(be_kind_of(String))
+ end
+ end
+end
+
+shared_examples_for "#script_data" do
+ describe "#script_data" do
+ subject { super().script_data }
+
+ it { is_expected.to be_kind_of(Hash) }
+ it { is_expected.not_to be_empty }
+
+ it "should contain String keys" do
+ expect(subject.keys).to all(be_kind_of(String))
+ end
+
+ it "should contain Arrays or Hashes" do
+ expect(subject.values).to all(be_kind_of(Array).or(be_kind_of(Hash)))
+ end
end
end