Skip to content
Browse files

Change network seed address for specs

  • Loading branch information...
1 parent e576c81 commit 9136042c02a1c8244b3cc850431ef7d259cad066 Dmitriy Kalinin and Pieter Noordhuis committed Mar 14, 2013
View
8 warden/spec/container/insecure_spec.rb
@@ -9,14 +9,6 @@
require "warden/container/insecure"
-def next_class_c
- $class_c ||= Warden::Network::Address.new("172.16.0.0")
-
- rv = $class_c
- $class_c = $class_c + 256
- rv
-end
-
describe "insecure" do
let(:work_path) { File.join(Dir.tmpdir, "warden", "spec") }
let(:unix_domain_path) { File.join(work_path, "warden.sock") }
View
8 warden/spec/container/linux_spec.rb
@@ -9,14 +9,6 @@
require "warden/container/linux"
-def next_class_c
- $class_c ||= Warden::Network::Address.new("172.16.0.0")
-
- rv = $class_c
- $class_c = $class_c + 256
- rv
-end
-
describe "linux", :platform => "linux", :needs_root => true do
let(:work_path) { File.join(Dir.tmpdir, "warden", "spec") }
let(:unix_domain_path) { File.join(work_path, "warden.sock") }
View
8 warden/spec/health_check_spec.rb
@@ -11,14 +11,6 @@
require "warden/container/linux"
-def next_class_c
- $class_c ||= Warden::Network::Address.new("172.16.0.0")
-
- rv = $class_c
- $class_c = $class_c + 256
- rv
-end
-
describe "health check" do
let(:work_path) { File.join(Dir.tmpdir, "warden", "spec") }
let(:unix_domain_path) { File.join(work_path, "warden.sock") }
View
2 warden/spec/spec_helper.rb
@@ -64,4 +64,6 @@ def done
Warden::Server.setup(config)
end
end
+
+ config.include(Helpers::Network)
end
View
17 warden/spec/support/helpers/network.rb
@@ -0,0 +1,17 @@
+module Helpers
+ module Network
+ def self.next_class_c
+ @class_c ||= Warden::Network::Address.new("172.28.0.0")
+
+ rv = @class_c
+ @class_c = @class_c + 256
+ rv
+ end
+
+ def self.included(base)
+ base.instance_eval do
+ let(:next_class_c) { Helpers::Network.next_class_c }
+ end
+ end
+ end
+end

0 comments on commit 9136042

Please sign in to comment.
Something went wrong with that request. Please try again.