Sha256: ca139b7d6d678a8b210413436ed5988526a87846d82481c16843b143ca4a3315

Contents?: true

Size: 774 Bytes

Versions: 17

Compression:

Stored size: 774 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))

module Johnson
  module Conversions
    class ThreadTest < Johnson::TestCase
      def test_manipulate_thread
        thread = Thread.new { }
        @runtime['thread'] = thread
        assert_js_equal(false, "thread.send('alive?')")
      end

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

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

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
jbarnette-johnson-1.0.0.200806240111 test/johnson/conversions/thread_test.rb
jbarnette-johnson-1.0.0.200807291507 test/johnson/conversions/thread_test.rb
jbarnette-johnson-1.0.0.200808062051 test/johnson/conversions/thread_test.rb
jbarnette-johnson-1.0.0.200808062111 test/johnson/conversions/thread_test.rb
jbarnette-johnson-1.0.0.200811251942 test/johnson/conversions/thread_test.rb
jbarnette-johnson-1.0.0.20081126120511 test/johnson/conversions/thread_test.rb
jbarnette-johnson-1.0.0.20090127202936 test/johnson/conversions/thread_test.rb
jbarnette-johnson-1.0.0.20090225110820 test/johnson/conversions/thread_test.rb
jbarnette-johnson-1.0.0.20090326122910 test/johnson/conversions/thread_test.rb
jbarnette-johnson-1.0.0.20090326154650 test/johnson/conversions/thread_test.rb
jbarnette-johnson-1.0.0.20090326161333 test/johnson/conversions/thread_test.rb
jbarnette-johnson-1.0.0.20090402144841 test/johnson/conversions/thread_test.rb
jbarnette-johnson-1.0.0.20090402155420 test/johnson/conversions/thread_test.rb
johnson-1.2.0 test/johnson/conversions/thread_test.rb
johnson-1.1.1 test/johnson/conversions/thread_test.rb
johnson-1.1.2 test/johnson/conversions/thread_test.rb
johnson-1.1.0 test/johnson/conversions/thread_test.rb