Skip to content

Commit

Permalink
Add specs for IPRangeEnum
Browse files Browse the repository at this point in the history
  • Loading branch information
moozzi committed May 2, 2024
1 parent 973f182 commit 95324ec
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions spec/builtin/ssl/ip_range_enum_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
require 'spec_helper'
require 'ronin/recon/builtin/net/ip_range_enum'

describe Ronin::Recon::Net::IPRangeEnum do
describe "#process" do
context "when there are ip in range" do
let(:ip_range) { Ronin::Recon::Values::IPRange.new('192.168.0.1/2') }

it "must yield IP values" do
yielded_values = []

subject.process(ip_range) do |value|
yielded_values << value
end
end
end

context "when there is no ip in range" do
let(:ip_range) { Ronin::Recon::Values::IPRange.new('192.168.0.1/2') }

it "must not yield anything" do
expect { |b|
subject.process(ip_range,&b)
}.to_not yield_control
end
end
end
end

0 comments on commit 95324ec

Please sign in to comment.