Sha256: 6def4e019bec6f5bbf42dbfe266e68eea488cbd5c754868ea2309c0e4f68c624

Contents?: true

Size: 777 Bytes

Versions: 64

Compression:

Stored size: 777 Bytes

Contents

RSpec.describe IPAddr do
  subject(:ip_address) { IPAddr.new('10.0.0.1') }
  
  describe '#==' do
    it { is_expected.to be == '10.0.0.1'}
    it { is_expected.to be == IPAddr.new('10.0.0.1')}
    it { is_expected.not_to be == 'foo'}
    
    it 'does not raise an error when compared to a non ip address' do
      expect {
        ip_address == 'foo'
      }.to_not raise_error
    end
  end
  
  describe '#include?' do
    subject(:ip_range) { IPAddr.new('10.0.0.1/24') }
    it { is_expected.to include '10.0.0.1'}
    it { is_expected.to include ip_address}
    it { is_expected.not_to include 'foo'}
    
    it 'does not raise an error when checking for a non ip address' do
      expect {
        ip_range.include? 'foo'
      }.to_not raise_error
    end
  end
  
end

Version data entries

64 entries across 64 versions & 2 rubygems

Version Path
wg-metasploit_data_models-4.1.4.02 spec/lib/ipaddr_spec.rb
metasploit_data_models-6.0.5 spec/lib/ipaddr_spec.rb
metasploit_data_models-6.0.4 spec/lib/ipaddr_spec.rb
metasploit_data_models-6.0.3 spec/lib/ipaddr_spec.rb
metasploit_data_models-6.0.2 spec/lib/ipaddr_spec.rb
metasploit_data_models-6.0.1 spec/lib/ipaddr_spec.rb
metasploit_data_models-6.0.0 spec/lib/ipaddr_spec.rb
metasploit_data_models-5.0.6 spec/lib/ipaddr_spec.rb
metasploit_data_models-5.0.5 spec/lib/ipaddr_spec.rb
metasploit_data_models-5.0.4 spec/lib/ipaddr_spec.rb
metasploit_data_models-5.0.3 spec/lib/ipaddr_spec.rb
metasploit_data_models-5.0.2 spec/lib/ipaddr_spec.rb
metasploit_data_models-5.0.1 spec/lib/ipaddr_spec.rb
metasploit_data_models-5.0.0 spec/lib/ipaddr_spec.rb
metasploit_data_models-4.1.4 spec/lib/ipaddr_spec.rb
metasploit_data_models-4.1.3 spec/lib/ipaddr_spec.rb
metasploit_data_models-4.1.2 spec/lib/ipaddr_spec.rb
metasploit_data_models-4.1.1 spec/lib/ipaddr_spec.rb
metasploit_data_models-4.1.0 spec/lib/ipaddr_spec.rb
metasploit_data_models-4.0.2 spec/lib/ipaddr_spec.rb