From 69bcc1a914889f9ecfd50c02d4266f685636731e Mon Sep 17 00:00:00 2001 From: Shin-ichiro OGAWA Date: Fri, 3 Sep 2010 11:53:11 +0900 Subject: [PATCH] Move IP_ADDRESS to IpAddresses classes of each carrier Signed-off-by: Shin-ichiro OGAWA --- lib/jpmobile.rb | 11 ++ lib/jpmobile/mobile/abstract_mobile.rb | 18 +- .../ip_addresses/abstract_ip_addresses.rb | 23 +++ lib/jpmobile/mobile/ip_addresses/au.rb | 40 +++++ lib/jpmobile/mobile/ip_addresses/docomo.rb | 22 +++ lib/jpmobile/mobile/ip_addresses/emobile.rb | 15 ++ lib/jpmobile/mobile/ip_addresses/softbank.rb | 20 +++ lib/jpmobile/mobile/ip_addresses/willcom.rb | 158 ++++++++++++++++++ lib/jpmobile/mobile/z_ip_addresses_au.rb | 27 --- lib/jpmobile/mobile/z_ip_addresses_docomo.rb | 15 -- lib/jpmobile/mobile/z_ip_addresses_emobile.rb | 10 -- .../mobile/z_ip_addresses_softbank.rb | 17 -- lib/jpmobile/mobile/z_ip_addresses_willcom.rb | 157 ----------------- spec/rack/jpmobile/softbank_spec.rb | 2 +- spec/unit/valid_ip_spec.rb | 8 +- test/legacy/autoload_test.rb | 33 ---- 16 files changed, 304 insertions(+), 272 deletions(-) create mode 100644 lib/jpmobile/mobile/ip_addresses/abstract_ip_addresses.rb create mode 100644 lib/jpmobile/mobile/ip_addresses/au.rb create mode 100644 lib/jpmobile/mobile/ip_addresses/docomo.rb create mode 100644 lib/jpmobile/mobile/ip_addresses/emobile.rb create mode 100644 lib/jpmobile/mobile/ip_addresses/softbank.rb create mode 100644 lib/jpmobile/mobile/ip_addresses/willcom.rb delete mode 100644 lib/jpmobile/mobile/z_ip_addresses_au.rb delete mode 100644 lib/jpmobile/mobile/z_ip_addresses_docomo.rb delete mode 100644 lib/jpmobile/mobile/z_ip_addresses_emobile.rb delete mode 100644 lib/jpmobile/mobile/z_ip_addresses_softbank.rb delete mode 100644 lib/jpmobile/mobile/z_ip_addresses_willcom.rb diff --git a/lib/jpmobile.rb b/lib/jpmobile.rb index 06f7a20d..1645cf0d 100644 --- a/lib/jpmobile.rb +++ b/lib/jpmobile.rb @@ -28,6 +28,17 @@ module Mobile autoload :Display, 'jpmobile/mobile/display' + module IpAddresses + autoload :AbstractIpAddresses, 'jpmobile/mobile/ip_addresses/abstract_ip_addresses' + autoload :Docomo, 'jpmobile/mobile/ip_addresses/docomo' + autoload :Au, 'jpmobile/mobile/ip_addresses/au' + autoload :Softbank, 'jpmobile/mobile/ip_addresses/softbank' + autoload :Vodafone, 'jpmobile/mobile/ip_addresses/softbank' + autoload :Willcom, 'jpmobile/mobile/ip_addresses/willcom' + autoload :Ddipocket, 'jpmobile/mobile/ip_addresses/willcom' + autoload :Emobile, 'jpmobile/mobile/ip_addresses/emobile' + end + DEFAULT_CARRIERS = %w(Docomo Au Softbank Vodafone Emobile Willcom Ddipocket Iphone Android WindowsPhone) def self.carriers diff --git a/lib/jpmobile/mobile/abstract_mobile.rb b/lib/jpmobile/mobile/abstract_mobile.rb index 47db0bbe..c76fb986 100644 --- a/lib/jpmobile/mobile/abstract_mobile.rb +++ b/lib/jpmobile/mobile/abstract_mobile.rb @@ -28,14 +28,10 @@ def ident_device; nil; end # そうでなければ +false+ を返す。 # IP空間が定義されていない場合は +nil+ を返す。 def self.valid_ip? remote_addr - addrs = nil - begin - addrs = self::IP_ADDRESSES - rescue NameError => e - return nil - end - remote = IPAddr.new(remote_addr) - addrs.any? {|ip| ip.include? remote } + @ip_list ||= ip_address_class + return false unless @ip_list + + @ip_list.valid_ip?(remote_addr) end def valid_ip? @@ -92,5 +88,11 @@ def params @request.params end end + + # + def self.ip_address_class +eval("::Jpmobile::Mobile::IpAddresses::#{self.to_s.split(/::/).last}") + eval("::Jpmobile::Mobile::IpAddresses::#{self.to_s.split(/::/).last}").new rescue nil + end end end diff --git a/lib/jpmobile/mobile/ip_addresses/abstract_ip_addresses.rb b/lib/jpmobile/mobile/ip_addresses/abstract_ip_addresses.rb new file mode 100644 index 00000000..b8ef7224 --- /dev/null +++ b/lib/jpmobile/mobile/ip_addresses/abstract_ip_addresses.rb @@ -0,0 +1,23 @@ +module Jpmobile + module Mobile + module IpAddresses + class AbstractIpAddresses + def valid_ip?(remote_ip_str) + begin + remote_ip = IPAddr.new(remote_ip_str) + rescue + return false + end + + self.class.ip_address_list.any? {|ip| ip.include?(remote_ip)} + end + + class << self + def ip_address_list + [] + end + end + end + end + end +end diff --git a/lib/jpmobile/mobile/ip_addresses/au.rb b/lib/jpmobile/mobile/ip_addresses/au.rb new file mode 100644 index 00000000..275b3854 --- /dev/null +++ b/lib/jpmobile/mobile/ip_addresses/au.rb @@ -0,0 +1,40 @@ +module Jpmobile + module Mobile + module IpAddresses + class Au < AbstractIpAddresses + class << self + def ip_address_list + @@ip_address_list ||= [ + "210.230.128.224/28", + "121.111.227.160/27", + "61.117.1.0/28", + "219.108.158.0/27", + "219.125.146.0/28", + "61.117.2.32/29", + "61.117.2.40/29", + "219.108.158.40/29", + "219.125.148.0/25", + "222.5.63.0/25", + "222.5.63.128/25", + "222.5.62.128/25", + "59.135.38.128/25", + "219.108.157.0/25", + "219.125.145.0/25", + "121.111.231.0/25", + "121.111.227.0/25", + "118.152.214.192/26", + "118.159.131.0/25", + "118.159.133.0/25", + "118.159.132.160/27", + "111.86.142.0/26", + "111.86.141.64/26", + "111.86.141.128/26", + "111.86.141.192/26", + "118.159.133.192/26" + ].map {|ip| IPAddr.new(ip) } + end + end + end + end + end +end diff --git a/lib/jpmobile/mobile/ip_addresses/docomo.rb b/lib/jpmobile/mobile/ip_addresses/docomo.rb new file mode 100644 index 00000000..cbccad4f --- /dev/null +++ b/lib/jpmobile/mobile/ip_addresses/docomo.rb @@ -0,0 +1,22 @@ +module Jpmobile + module Mobile + module IpAddresses + class Docomo < AbstractIpAddresses + class << self + def ip_address_list + @@ip_address_list ||= [ + "210.153.84.0/24", + "210.136.161.0/24", + "210.153.86.0/24", + "124.146.174.0/24", + "124.146.175.0/24", + "202.229.176.0/24", + "202.229.177.0/24", + "202.229.178.0/24" + ].map {|ip| IPAddr.new(ip)} + end + end + end + end + end +end diff --git a/lib/jpmobile/mobile/ip_addresses/emobile.rb b/lib/jpmobile/mobile/ip_addresses/emobile.rb new file mode 100644 index 00000000..ba778f63 --- /dev/null +++ b/lib/jpmobile/mobile/ip_addresses/emobile.rb @@ -0,0 +1,15 @@ +module Jpmobile + module Mobile + module IpAddresses + class Emobile < AbstractIpAddresses + class << self + def ip_address_list + @@ip_address_list ||= [ + "117.55.1.224/27" + ].map {|ip| IPAddr.new(ip) } + end + end + end + end + end +end diff --git a/lib/jpmobile/mobile/ip_addresses/softbank.rb b/lib/jpmobile/mobile/ip_addresses/softbank.rb new file mode 100644 index 00000000..ed4f6901 --- /dev/null +++ b/lib/jpmobile/mobile/ip_addresses/softbank.rb @@ -0,0 +1,20 @@ +module Jpmobile + module Mobile + module IpAddresses + class Softbank < AbstractIpAddresses + class << self + def ip_address_list + @@ip_address_list ||= [ + "123.108.237.0/27", + "202.253.96.224/27", + "210.146.7.192/26", + "210.175.1.128/25" + ].map {|ip| IPAddr.new(ip) } + end + end + end + class Vodafone < Softbank + end + end + end +end diff --git a/lib/jpmobile/mobile/ip_addresses/willcom.rb b/lib/jpmobile/mobile/ip_addresses/willcom.rb new file mode 100644 index 00000000..7d98a1a1 --- /dev/null +++ b/lib/jpmobile/mobile/ip_addresses/willcom.rb @@ -0,0 +1,158 @@ +module Jpmobile + module Mobile + module IpAddresses + class Willcom < AbstractIpAddresses + class << self + def ip_address_list + @@ip_address_list ||= [ + "61.198.128.0/24", + "61.198.129.0/24", + "61.198.130.0/24", + "61.198.131.0/24", + "61.198.132.0/24", + "61.198.133.0/24", + "61.198.134.0/24", + "61.198.135.0/24", + "61.198.136.0/24", + "61.198.137.0/24", + "61.198.138.100/32", + "61.198.138.101/32", + "61.198.138.102/32", + "61.198.138.103/32", + "61.198.139.0/29", + "61.198.139.128/27", + "61.198.139.160/28", + "61.198.140.0/24", + "61.198.141.0/24", + "61.198.142.0/24", + "61.198.143.0/24", + "61.198.160.0/24", + "61.198.161.0/24", + "61.198.162.0/24", + "61.198.163.0/24", + "61.198.164.0/24", + "61.198.165.0/24", + "61.198.166.0/24", + "61.198.168.0/24", + "61.198.169.0/24", + "61.198.170.0/24", + "61.198.171.0/24", + "61.198.172.0/24", + "61.198.173.0/24", + "61.198.174.0/24", + "61.198.175.0/24", + "61.198.248.0/24", + "61.198.249.0/24", + "61.198.250.0/24", + "61.198.251.0/24", + "61.198.252.0/24", + "61.198.253.0/24", + "61.198.254.0/24", + "61.198.255.0/24", + "61.204.0.0/24", + "61.204.2.0/24", + "61.204.3.0/25", + "61.204.3.128/25", + "61.204.4.0/24", + "61.204.5.0/24", + "61.204.6.0/25", + "61.204.6.128/25", + "61.204.7.0/25", + "61.204.92.0/24", + "61.204.93.0/24", + "61.204.94.0/24", + "61.204.95.0/24", + "114.20.49.0/24", + "114.20.50.0/24", + "114.20.51.0/24", + "114.20.52.0/24", + "114.20.53.0/24", + "114.20.54.0/24", + "114.20.55.0/24", + "114.20.56.0/24", + "114.20.57.0/24", + "114.20.58.0/24", + "114.20.59.0/24", + "114.20.60.0/24", + "114.20.61.0/24", + "114.20.62.0/24", + "114.20.63.0/24", + "114.20.64.0/24", + "114.20.65.0/24", + "114.20.66.0/24", + "114.20.67.0/24", + "114.21.255.0/27", + "125.28.0.0/24", + "125.28.1.0/24", + "125.28.15.0/24", + "125.28.16.0/24", + "125.28.17.0/24", + "125.28.2.0/24", + "125.28.3.0/24", + "125.28.4.0/24", + "125.28.5.0/24", + "125.28.8.0/24", + "210.168.246.0/24", + "210.168.247.0/24", + "210.169.92.0/24", + "210.169.93.0/24", + "210.169.94.0/24", + "210.169.95.0/24", + "210.169.96.0/24", + "210.169.97.0/24", + "210.169.98.0/24", + "210.169.99.0/24", + "211.126.192.128/25", + "211.18.232.0/24", + "211.18.233.0/24", + "211.18.234.0/24", + "211.18.235.0/24", + "211.18.236.0/24", + "211.18.237.0/24", + "219.108.10.0/24", + "219.108.11.0/24", + "219.108.12.0/24", + "219.108.13.0/24", + "219.108.14.0/24", + "219.108.15.0/24", + "219.108.7.0/24", + "219.108.8.0/24", + "219.108.9.0/24", + "221.119.0.0/24", + "221.119.1.0/24", + "221.119.2.0/24", + "221.119.3.0/24", + "221.119.4.0/24", + "221.119.6.0/24", + "221.119.7.0/24", + "221.119.8.0/24", + "221.119.9.0/24", + "114.20.49.0/24", + "114.20.50.0/24", + "114.20.51.0/24", + "114.20.52.0/24", + "114.20.53.0/24", + "114.20.54.0/24", + "114.20.55.0/24", + "114.20.56.0/24", + "114.20.57.0/24", + "114.20.58.0/24", + "114.20.59.0/24", + "114.20.60.0/24", + "114.20.61.0/24", + "114.20.62.0/24", + "114.20.63.0/24", + "114.20.64.0/24", + "114.20.65.0/24", + "114.20.66.0/24", + "114.20.67.0/24", + "114.21.255.0/27" + ].map {|ip| IPAddr.new(ip) } + end + end + end + class Ddipocket < Willcom + end + end + end +end diff --git a/lib/jpmobile/mobile/z_ip_addresses_au.rb b/lib/jpmobile/mobile/z_ip_addresses_au.rb deleted file mode 100644 index 0b2f334e..00000000 --- a/lib/jpmobile/mobile/z_ip_addresses_au.rb +++ /dev/null @@ -1,27 +0,0 @@ -Jpmobile::Mobile::Au::IP_ADDRESSES = -["210.230.128.224/28", - "121.111.227.160/27", - "61.117.1.0/28", - "219.108.158.0/27", - "219.125.146.0/28", - "61.117.2.32/29", - "61.117.2.40/29", - "219.108.158.40/29", - "219.125.148.0/25", - "222.5.63.0/25", - "222.5.63.128/25", - "222.5.62.128/25", - "59.135.38.128/25", - "219.108.157.0/25", - "219.125.145.0/25", - "121.111.231.0/25", - "121.111.227.0/25", - "118.152.214.192/26", - "118.159.131.0/25", - "118.159.133.0/25", - "118.159.132.160/27", - "111.86.142.0/26", - "111.86.141.64/26", - "111.86.141.128/26", - "111.86.141.192/26", - "118.159.133.192/26"].map {|ip| IPAddr.new(ip) } diff --git a/lib/jpmobile/mobile/z_ip_addresses_docomo.rb b/lib/jpmobile/mobile/z_ip_addresses_docomo.rb deleted file mode 100644 index ad292c12..00000000 --- a/lib/jpmobile/mobile/z_ip_addresses_docomo.rb +++ /dev/null @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- -# = IPアドレス帯域テーブル(手動更新分) -# == DoCoMo -# http://www.nttdocomo.co.jp/service/imode/make/content/ip/index.html -# 2008/09現在 -Jpmobile::Mobile::Docomo::IP_ADDRESSES = %w( -210.153.84.0/24 -210.136.161.0/24 -210.153.86.0/24 -124.146.174.0/24 -124.146.175.0/24 -202.229.176.0/24 -202.229.177.0/24 -202.229.178.0/24 -).map {|ip| IPAddr.new(ip) } diff --git a/lib/jpmobile/mobile/z_ip_addresses_emobile.rb b/lib/jpmobile/mobile/z_ip_addresses_emobile.rb deleted file mode 100644 index 2726b94e..00000000 --- a/lib/jpmobile/mobile/z_ip_addresses_emobile.rb +++ /dev/null @@ -1,10 +0,0 @@ -# = IPアドレス帯域テーブル(手動更新分) -# == EMOBILE -# http://developer.emnet.ne.jp/ipaddress.html -# 2008/02/26現在 - -#:enddoc: - -Jpmobile::Mobile::Emobile::IP_ADDRESSES = %w( -117.55.1.224/27 -).map {|ip| IPAddr.new(ip) } diff --git a/lib/jpmobile/mobile/z_ip_addresses_softbank.rb b/lib/jpmobile/mobile/z_ip_addresses_softbank.rb deleted file mode 100644 index 2bac0782..00000000 --- a/lib/jpmobile/mobile/z_ip_addresses_softbank.rb +++ /dev/null @@ -1,17 +0,0 @@ -# -*- coding: utf-8 -*- -# = IPアドレス帯域テーブル(手動更新分) -# == SoftBank -# http://developers.softbankmobile.co.jp/dp/tech_svc/web/ip.php -# 2007/10/09現在 -Jpmobile::Mobile::Softbank::IP_ADDRESSES = %w( -123.108.236.0/24 -123.108.237.0/27 -202.179.204.0/24 -202.253.96.224/27 -210.146.7.192/26 -210.146.60.192/26 -210.151.9.128/26 -210.175.1.128/25 -211.8.159.128/25 -210.175.1.128/25 -).map {|ip| IPAddr.new(ip) } diff --git a/lib/jpmobile/mobile/z_ip_addresses_willcom.rb b/lib/jpmobile/mobile/z_ip_addresses_willcom.rb deleted file mode 100644 index 1bc416bc..00000000 --- a/lib/jpmobile/mobile/z_ip_addresses_willcom.rb +++ /dev/null @@ -1,157 +0,0 @@ -Jpmobile::Mobile::Willcom::IP_ADDRESSES = -["61.198.128.0/24", - "61.198.129.0/24", - "61.198.130.0/24", - "61.198.131.0/24", - "61.198.132.0/24", - "61.198.133.0/24", - "61.198.134.0/24", - "61.198.135.0/24", - "61.198.136.0/24", - "61.198.137.0/24", - "61.198.138.100/32", - "61.198.138.101/32", - "61.198.138.102/32", - "61.198.138.103/32", - "61.198.139.0/29", - "61.198.139.128/27", - "61.198.139.160/28", - "61.198.140.0/24", - "61.198.141.0/24", - "61.198.142.0/24", - "61.198.143.0/24", - "61.198.160.0/24", - "61.198.161.0/24", - "61.198.162.0/24", - "61.198.163.0/24", - "61.198.164.0/24", - "61.198.165.0/24", - "61.198.166.0/24", - "61.198.168.0/24", - "61.198.169.0/24", - "61.198.170.0/24", - "61.198.171.0/24", - "61.198.172.0/24", - "61.198.173.0/24", - "61.198.174.0/24", - "61.198.175.0/24", - "61.198.248.0/24", - "61.198.249.0/24", - "61.198.250.0/24", - "61.198.251.0/24", - "61.198.252.0/24", - "61.198.253.0/24", - "61.198.254.0/24", - "61.198.255.0/24", - "61.204.0.0/24", - "61.204.2.0/24", - "61.204.3.0/25", - "61.204.3.128/25", - "61.204.4.0/24", - "61.204.5.0/24", - "61.204.6.0/25", - "61.204.6.128/25", - "61.204.7.0/25", - "61.204.92.0/24", - "61.204.93.0/24", - "61.204.94.0/24", - "61.204.95.0/24", - "114.20.49.0/24", - "114.20.50.0/24", - "114.20.51.0/24", - "114.20.52.0/24", - "114.20.53.0/24", - "114.20.54.0/24", - "114.20.55.0/24", - "114.20.56.0/24", - "114.20.57.0/24", - "114.20.58.0/24", - "114.20.59.0/24", - "114.20.60.0/24", - "114.20.61.0/24", - "114.20.62.0/24", - "114.20.63.0/24", - "114.20.64.0/24", - "114.20.65.0/24", - "114.20.66.0/24", - "114.20.67.0/24", - "114.21.255.0/27", - "125.28.0.0/24", - "125.28.1.0/24", - "125.28.15.0/24", - "125.28.16.0/24", - "125.28.17.0/24", - "125.28.2.0/24", - "125.28.3.0/24", - "125.28.4.0/24", - "125.28.5.0/24", - "125.28.8.0/24", - "210.168.246.0/24", - "210.168.247.0/24", - "210.169.92.0/24", - "210.169.93.0/24", - "210.169.94.0/24", - "210.169.95.0/24", - "210.169.96.0/24", - "210.169.97.0/24", - "210.169.98.0/24", - "210.169.99.0/24", - "211.126.192.128/25", - "211.18.232.0/24", - "211.18.233.0/24", - "211.18.234.0/24", - "211.18.235.0/24", - "211.18.236.0/24", - "211.18.237.0/24", - "219.108.10.0/24", - "219.108.11.0/24", - "219.108.12.0/24", - "219.108.13.0/24", - "219.108.14.0/24", - "219.108.15.0/24", - "219.108.7.0/24", - "219.108.8.0/24", - "219.108.9.0/24", - "221.119.0.0/24", - "221.119.1.0/24", - "221.119.2.0/24", - "221.119.3.0/24", - "221.119.4.0/24", - "221.119.6.0/24", - "221.119.7.0/24", - "221.119.8.0/24", - "221.119.9.0/24", - "114.20.49.0/24", - "114.20.50.0/24", - "114.20.51.0/24", - "114.20.52.0/24", - "114.20.53.0/24", - "114.20.54.0/24", - "114.20.55.0/24", - "114.20.56.0/24", - "114.20.57.0/24", - "114.20.58.0/24", - "114.20.59.0/24", - "114.20.60.0/24", - "114.20.61.0/24", - "114.20.62.0/24", - "114.20.63.0/24", - "114.20.64.0/24", - "114.20.65.0/24", - "114.20.66.0/24", - "114.20.67.0/24", - "114.21.255.0/27", - "219.108.2.0/24", - "219.108.3.0/24", - "125.28.6.0/24", - "125.28.7.0/24", - "125.28.11.0/24", - "125.28.12.0/24", - "125.28.13.0/24", - "125.28.14.0/24", - "211.18.238.0/24", - "211.18.239.0/24", - "219.108.4.0/24", - "219.108.5.0/24", - "219.108.6.0/24", - "221.119.5.0/24"].map {|ip| IPAddr.new(ip) } diff --git a/spec/rack/jpmobile/softbank_spec.rb b/spec/rack/jpmobile/softbank_spec.rb index 86f82bf2..3230b360 100644 --- a/spec/rack/jpmobile/softbank_spec.rb +++ b/spec/rack/jpmobile/softbank_spec.rb @@ -70,7 +70,7 @@ res = Rack::MockRequest.env_for( 'http://jpmobile-rails.org/', 'HTTP_USER_AGENT' => "Vodafone/1.0/V903T/TJ001 Browser/VF-Browser/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 Ext-J-Profile/JSCL-1.2.2 Ext-V-Profile/VSCL-2.0.0", - "REMOTE_ADDR"=>"202.179.204.1") + "REMOTE_ADDR"=>"210.175.1.130") env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1] env['rack.jpmobile'].valid_ip?.should be_true diff --git a/spec/unit/valid_ip_spec.rb b/spec/unit/valid_ip_spec.rb index a114dbc8..14ec807c 100644 --- a/spec/unit/valid_ip_spec.rb +++ b/spec/unit/valid_ip_spec.rb @@ -6,10 +6,10 @@ [ '210.153.84.254' , :Docomo ], [ '210.230.128.225' , :Au ], [ '210.230.128.238' , :Au ], - [ '123.108.236.1' , :Softbank ], - [ '123.108.236.254' , :Softbank ], - [ '123.108.236.1' , :Vodafone ], - [ '123.108.236.254' , :Vodafone ], + [ '123.108.237.1' , :Softbank ], + [ '123.108.237.31' , :Softbank ], + [ '123.108.237.1' , :Vodafone ], + [ '123.108.237.31' , :Vodafone ], [ '61.198.142.1' , :Willcom ], [ '61.198.142.254' , :Willcom ], [ '61.198.142.1' , :Ddipocket ], diff --git a/test/legacy/autoload_test.rb b/test/legacy/autoload_test.rb index 24c7bf58..5742c880 100644 --- a/test/legacy/autoload_test.rb +++ b/test/legacy/autoload_test.rb @@ -7,42 +7,9 @@ module Mobile end class TestAutoLoad < Test::Unit::TestCase - def test_ip_addresses_docomo - require 'jpmobile/mobile/docomo' - assert_nothing_raised { Jpmobile::Mobile::Docomo::IP_ADDRESSES } - assert_kind_of(Array, Jpmobile::Mobile::Docomo::IP_ADDRESSES) - end - def test_display_info_docomo require 'jpmobile/mobile/docomo' assert_nothing_raised { Jpmobile::Mobile::Docomo::DISPLAY_INFO } assert_kind_of(Hash, Jpmobile::Mobile::Docomo::DISPLAY_INFO) end - - def test_ip_addresses_au - require 'jpmobile/mobile/au' - assert_nothing_raised { Jpmobile::Mobile::Au::IP_ADDRESSES } - assert_kind_of(Array, Jpmobile::Mobile::Au::IP_ADDRESSES) - end - - def test_ip_addresses_softbank - require 'jpmobile/mobile/softbank' - assert_nothing_raised { Jpmobile::Mobile::Softbank::IP_ADDRESSES } - assert_nothing_raised { Jpmobile::Mobile::Vodafone::IP_ADDRESSES } - assert_kind_of(Array, Jpmobile::Mobile::Softbank::IP_ADDRESSES) - assert_kind_of(Array, Jpmobile::Mobile::Vodafone::IP_ADDRESSES) - end - - def test_ip_addresses_willcom - require 'jpmobile/mobile/willcom' - assert_nothing_raised { Jpmobile::Mobile::Willcom::IP_ADDRESSES } - assert_kind_of(Array, Jpmobile::Mobile::Willcom::IP_ADDRESSES) - end - - def test_ip_addresses_emobile - require 'jpmobile/mobile/emobile' - assert_nothing_raised { Jpmobile::Mobile::Emobile::IP_ADDRESSES } - assert_kind_of(Array, Jpmobile::Mobile::Emobile::IP_ADDRESSES) - end - end