From 9a8c5baa4e7e7e5f03a2b82f2f89aaaeed60fee8 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Mon, 2 Nov 2009 01:27:49 -0500 Subject: [PATCH] String is a primitive --- lib/odb/marshal.rb | 1 + spec/odb/marshal_spec.rb | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib/odb/marshal.rb b/lib/odb/marshal.rb index 976bf77..4213112 100644 --- a/lib/odb/marshal.rb +++ b/lib/odb/marshal.rb @@ -21,6 +21,7 @@ def load str TrueClass, Fixnum, Float, + String, Symbol, Time, Regexp diff --git a/spec/odb/marshal_spec.rb b/spec/odb/marshal_spec.rb index 5485e27..7dcfd28 100644 --- a/spec/odb/marshal_spec.rb +++ b/spec/odb/marshal_spec.rb @@ -135,6 +135,10 @@ def initialize val1 dump_and_load(regex).should == regex end + it "should be able to serialize a string" do + dump_and_load("foobar").should == "foobar" + end + it "should be able to serialize & marshal a time object" do t = Time.now