Permalink
Browse files

Changed to bytes function to take care of false

  • Loading branch information...
1 parent 128d187 commit c1fb79db044cf42b8b5e583df5c70575c5902fdc @sivajag sivajag committed Sep 30, 2010
Showing with 11 additions and 2 deletions.
  1. +10 −1 spec/org/rathore/amit/capjure_spec.clj
  2. +1 −1 src/org/rathore/amit/capjure.clj
@@ -110,5 +110,14 @@
(is (= (count cart-items) 2))
(is (= (cart-item :sku) "OB-BW-LNGR (RED) LL"))
(is (= (cart-item :merchant_product_id) "OB-BW-LNGR"))))
-
+
+
+(deftest test-to-bytes
+ (are [expected value] (= expected (String. (to-bytes value)))
+
+ "" nil
+ "true" true
+ "false" false
+ "420" 420
+ "string" "string"))
@@ -83,7 +83,7 @@
(insert-with-put object-to-save hbase-table-name put))))
(defn to-bytes [value]
- (Bytes/toBytes (str (or value ""))))
+ (Bytes/toBytes (str value)))
(defn add-to-insert-batch [put flattened-list]
(doseq [[column value] flattened-list]

0 comments on commit c1fb79d

Please sign in to comment.