about summary refs log tree commit homepage
path: root/test/test_fresh.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_fresh.rb')
-rw-r--r--test/test_fresh.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/test_fresh.rb b/test/test_fresh.rb
index b7882cd..41c30ef 100644
--- a/test/test_fresh.rb
+++ b/test/test_fresh.rb
@@ -14,4 +14,16 @@ class TestMogFresh < Test::Unit::TestCase
       client.list_keys
     end
   end
+
+  def test_invalid_key_exists
+    add_host_device_domain
+    domain = @domain + ".non-existent"
+    client = MogileFS::MogileFS.new :hosts => @hosts, :domain => domain
+    assert_raises(MogileFS::Backend::UnregDomainError) do
+      client.exist?("FOO")
+    end
+
+    client = MogileFS::MogileFS.new :hosts => @hosts, :domain => @domain
+    assert_equal false, client.exist?("non-existent")
+  end
 end