Skip to content

Commit

Permalink
Make sure string parsing starts with a string
Browse files Browse the repository at this point in the history
  • Loading branch information
ianwhite committed Aug 25, 2010
1 parent 8fb1f08 commit 03d9d7a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pickle/ref.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def parse_hash(orig)
end

def parse_string(orig)
str = orig.dup
str = orig.to_s.dup
apply_mappings!(str)
@index = parse_index!(str)
@factory = parse_factory!(str)
Expand Down
4 changes: 4 additions & 0 deletions spec/pickle/ref_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@
end
end
end

it "should raise InvalidPickleRefError when called with (1)" do
lambda { Pickle::Ref.new(1) }.should raise_error(Pickle::InvalidPickleRefError)
end
end

describe "(config = Config.new" do
Expand Down

0 comments on commit 03d9d7a

Please sign in to comment.