Permalink
Browse files

again

  • Loading branch information...
1 parent d9500d1 commit b44bc2e391280b95c8f2ace65b3bcd4ad2beac4b @brianmario committed Sep 22, 2011
Showing with 3 additions and 1 deletion.
  1. +1 −1 ext/yajl/yajl_ext.c
  2. +2 −0 spec/encoding/encoding_spec.rb
View
@@ -192,8 +192,8 @@ void yajl_encode_part(void * wrapper, VALUE obj, VALUE io) {
len = RSTRING_LEN(str);
status = yajl_gen_number(w->encoder, cptr, len);
} else {
+ rb_p(rb_funcall(obj, rb_intern("method"), 1, ID2SYM(intern_to_s)));
str = rb_funcall(obj, intern_to_s, 0);
- fprintf(stderr, "Value is: %s\n", RSTRING_PTR(rb_inspect(str)));
Check_Type(str, T_STRING);
cptr = RSTRING_PTR(str);
len = RSTRING_LEN(str);
@@ -265,6 +265,8 @@ def to_s
it "return value of #to_s must be a string" do
lambda {
+ val = TheMindKillerDuce.new.to_s
+ puts "Value is: #{val.inspect}"
Yajl::Encoder.encode(TheMindKillerDuce.new)
}.should raise_error(TypeError)
end

0 comments on commit b44bc2e

Please sign in to comment.