about summary refs log tree commit homepage
path: root/test/fresh.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/fresh.rb')
-rw-r--r--test/fresh.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/fresh.rb b/test/fresh.rb
index 217a5c3..9490d34 100644
--- a/test/fresh.rb
+++ b/test/fresh.rb
@@ -115,14 +115,13 @@ EOF
       @admin.delete_class(domain, "klassy") rescue nil
   end
 
-  def test_device_file_add
+  def add_host_device_domain
     assert_equal [], @admin.get_hosts
     args = { :ip => @test_host, :port => @mogstored_http_port }
     args[:status] = "alive"
     @admin.create_host("me", args)
     Dir.mkdir("#@docroot/dev1")
     Dir.mkdir("#@docroot/dev2")
-
     yield_for_monitor_update { @admin.get_hosts.empty? or break }
 
     # TODO: allow adding devices via our MogileFS::Admin class
@@ -148,7 +147,12 @@ EOF
     domain = "rbmogtest.#$$"
     @admin.create_domain(domain)
     yield_for_monitor_update { @admin.get_domains.include?(domain) and break }
-    client = MogileFS::MogileFS.new :hosts => @hosts, :domain => domain
+    @domain = domain
+  end
+
+  def test_device_file_add
+    add_host_device_domain
+    client = MogileFS::MogileFS.new :hosts => @hosts, :domain => @domain
     r, w = IO.pipe
     thr = Thread.new do
       (0..9).each do |i|