Skip to content
This repository has been archived by the owner on Aug 18, 2018. It is now read-only.

Commit

Permalink
adding threading test
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Apr 24, 2008
1 parent 5732d81 commit c8e3eac
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext/spidermonkey/conversions.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ JSBool convert_to_js(OurContext* context, VALUE ruby, jsval* retval)
if (ruby_value_is_proxy(ruby))
return unwrap_ruby_land_proxy(context, ruby, retval);

if (rb_cProc == rb_class_of(ruby) || rb_cMethod == rb_class_of(ruby))
return make_js_land_proxy(context, ruby, retval);
// If we can't identify the object, just wrap it
return make_js_land_proxy(context, ruby, retval);

default:
Johnson_Error_raise("unknown ruby type in switch");
Expand Down
17 changes: 17 additions & 0 deletions test/johnson/conversions/thread_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))

module Johnson
module Conversions
class ThreadTest < Johnson::TestCase
def setup
@context = Johnson::Context.new
end

def test_manipulate_thread
thread = Thread.new { }
@context['thread'] = thread
assert_js_equal(false, "thread.send('alive?')")
end
end
end
end

0 comments on commit c8e3eac

Please sign in to comment.