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

Commit

Permalink
adding a threading todo test file
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Apr 30, 2008
1 parent faeef59 commit 3361d7c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
7 changes: 0 additions & 7 deletions todo/example_test.rb

This file was deleted.

22 changes: 22 additions & 0 deletions todo/threading_test.rb
@@ -0,0 +1,22 @@
require File.expand_path(File.join(File.dirname(__FILE__), "/../test/helper"))

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

def test_new_js_thread
@context.evaluate('function testing() { Ruby.sleep(10); }')
@context.evaluate('new Ruby.Thread(function() { testing(); })')
end

def test_js_thread_read_file
@context['filename'] = File.expand_path(__FILE__)
@context.evaluate('function testing() { Ruby.File.read(filename); }')
@context.evaluate('new Ruby.Thread(function() { testing(); })')
end
end
end
end

0 comments on commit 3361d7c

Please sign in to comment.