]> git.saurik.com Git - redis.git/blobdiff - client-libraries/scala/src/test/scala/com/redis/RedisClientSpec.scala
Scala client added thanks to Alejanro Crosa
[redis.git] / client-libraries / scala / src / test / scala / com / redis / RedisClientSpec.scala
diff --git a/client-libraries/scala/src/test/scala/com/redis/RedisClientSpec.scala b/client-libraries/scala/src/test/scala/com/redis/RedisClientSpec.scala
new file mode 100644 (file)
index 0000000..804a19a
--- /dev/null
@@ -0,0 +1,27 @@
+import org.specs._
+import com.redis._
+
+import org.specs.mock.Mockito
+import org.mockito.Mock._
+import org.mockito.Mockito._
+import org.mockito.Mockito.doNothing
+
+object RedisClientSpec extends Specification with Mockito {
+
+  "Redis Client" should {
+    var client: Redis = null
+    
+    "print formatted client status" in {
+      client = new Redis("localhost", 121212)
+      client.toString must be matching("localhost:121212 <connected:false>")
+    }
+    
+    "get the same connection when passing key para or not since it's a single node" in {
+      client.getConnection("key") mustEqual client.getConnection
+    }
+    
+    "use db zero as default" in {
+      client.db mustEqual 0
+    }
+  }
+}