Permalink
Browse files

test case to make sure regex in hash is to_s, since JSON.parse(/a/.to…

…_json) doesnt work
  • Loading branch information...
1 parent acb3628 commit 3628803c04ef98ee0902536e872873f46fa7c563 Darragh Curran committed Dec 14, 2009
Showing with 5 additions and 0 deletions.
  1. +5 −0 spec/exceptional/exception_data_spec.rb
View
5 spec/exceptional/exception_data_spec.rb
@@ -86,6 +86,11 @@ def initialize
Exceptional::ControllerExceptionData.sanitize_hash(input).should == {'crazy' => crazy.to_s, :simple => '123', :some_hash => {'1' => '2'}, :array => ['1','2']}
end
+ it "to_strings regex because JSON.parse(/aa/.to_json) doesn't work" do
+ input = {'crazy' => /abc.*/}
+ Exceptional::ExceptionData.sanitize_hash(input).should == {'crazy' => /abc.*/.to_s}
+ end
+
it "handles session objects with various interfaces" do
class SessionWithInstanceVariables
def initialize

0 comments on commit 3628803

Please sign in to comment.