Skip to content

Commit

Permalink
Add specs for IPRangeEnum (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
moozzi authored May 2, 2024
1 parent 6d71c77 commit 319b01a
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions spec/builtin/ssl/ip_range_enum_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
require 'spec_helper'
require 'ronin/recon/builtin/net/ip_range_enum'

describe Ronin::Recon::Net::IPRangeEnum do
describe "#process" do
context "when there are ips within the range" do
let(:ip_range) { Ronin::Recon::Values::IPRange.new('192.168.0.1/30') }
let(:addresses) do
[
"192.168.0.0",
"192.168.0.1",
"192.168.0.2",
"192.168.0.3"
]
end

it "must yield each value" do
yielded_values = []

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

expect(yielded_values).to_not be_empty
expect(yielded_values).to all(be_kind_of(Ronin::Recon::Values::IP))
expect(yielded_values.map(&:address)).to match_array(addresses)
end
end
end
end

0 comments on commit 319b01a

Please sign in to comment.