diff --git a/spec/lib/msf/java/rmi/client/registry_spec.rb b/spec/lib/msf/java/rmi/client/registry_spec.rb index ce7496e567..702d37cfc3 100644 --- a/spec/lib/msf/java/rmi/client/registry_spec.rb +++ b/spec/lib/msf/java/rmi/client/registry_spec.rb @@ -163,6 +163,10 @@ describe Msf::Java::Rmi::Client::Registry do allow_any_instance_of(::StringIO).to receive(:get_once) do |io, length, timeout| io.read end + + allow_any_instance_of(::StringIO).to receive(:has_read_data?) do |io| + false + end end it "returns empty array" do @@ -181,6 +185,10 @@ describe Msf::Java::Rmi::Client::Registry do allow_any_instance_of(::StringIO).to receive(:get_once) do |io, length, timeout| io.read end + + allow_any_instance_of(::StringIO).to receive(:has_read_data?) do |io| + false + end end it "returns the list of registered names" do @@ -202,6 +210,10 @@ describe Msf::Java::Rmi::Client::Registry do allow_any_instance_of(::StringIO).to receive(:get_once) do |io, length, timeout| io.read end + + allow_any_instance_of(::StringIO).to receive(:has_read_data?) do |io| + false + end end it "raises an Rex::Proto::Rmi::Exception" do @@ -220,6 +232,10 @@ describe Msf::Java::Rmi::Client::Registry do allow_any_instance_of(::StringIO).to receive(:get_once) do |io, length, timeout| io.read end + + allow_any_instance_of(::StringIO).to receive(:has_read_data?) do |io| + false + end end it "returns the reference information" do