Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add two more address ranges to the "documentation" block of address space, as per RFC 5737 #1

Merged
merged 1 commit into from

2 participants

@smgoller

This also updates the specs to run under RSpec2.

@pr0d1r2
Owner

Thank you very much :)

@pr0d1r2 pr0d1r2 merged commit 0aca822 into pr0d1r2:master
@pr0d1r2
Owner

I have also made some updates to gem and released version 1.0.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 14, 2013
  1. @smgoller

    Update documentation space to reflect RFC 5737.

    smgoller authored
    Update specs to run under rspec 2.
This page is out of date. Refresh to see the latest.
View
2  lib/ipv4_address.rb
@@ -7,7 +7,7 @@ class IPv4Address < IPAddr
PRIVATE = ['10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16']
LOOPBACK = ['127.0.0.0/8']
LINK_LOCAL = ['169.254.0.0/16']
- DOCUMENTATION = ['192.0.2.0/24']
+ DOCUMENTATION = ['192.0.2.0/24', '198.51.100.0/24', '203.0.113.0/24']
IPV6_RELAY = ['192.88.99.0/24']
BENCHMARK = ['198.18.0.0/15']
MULTICAST = ['224.0.0.0/4']
View
6 spec/ipv4_address_spec.rb
@@ -167,6 +167,8 @@
it 'should be true when is not in documentation pool' do
%w(
192.0.2.1
+ 198.51.100.1
+ 203.0.113.1
).each do |address|
IPv4Address.documentation?(address).should be_true
end
@@ -365,7 +367,7 @@
describe 'self.internet_routable?' do
before(:each) do
- @ipv4_address = mock(IPv4Address, :internet_routable? => false)
+ @ipv4_address = double(IPv4Address, :internet_routable? => false)
end
it 'should be true when given string is an ip address and it is internet routable' do
@@ -395,7 +397,7 @@
describe 'internet_routable?' do
before(:each) do
- @ipv4_address.stub!(
+ @ipv4_address.stub(
:reserved? => false,
:private? => false,
:loopback? => false,
View
5 spec/spec_helper.rb
@@ -1,9 +1,8 @@
$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'ipv4_address'
-require 'spec'
-require 'spec/autorun'
+require 'rspec/autorun'
-Spec::Runner.configure do |config|
+RSpec.configure do |config|
end
Something went wrong with that request. Please try again.