Sha256: 8b4f009af3e6e512695501905ad8d32b35079895e5170beea00f48cf96047830

Contents?: true

Size: 767 Bytes

Versions: 10

Compression:

Stored size: 767 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

10 entries across 10 versions & 4 rubygems

Version Path
johnson19-2.0.0.pre3 test/johnson/generic/conversions/thread_test.rb
pre-johnson-2.0.0 test/johnson/generic/conversions/thread_test.rb
johnson-2.0.0.pre3 test/johnson/generic/conversions/thread_test.rb
johnson-2.0.0.pre2 test/johnson/generic/conversions/thread_test.rb
johnson-2.0.0.pre1 test/johnson/generic/conversions/thread_test.rb
johnson-2.0.0.pre0 test/johnson/generic/conversions/thread_test.rb
smparkes-johnson-1.1.2.6 test/johnson/generic/conversions/thread_test.rb
smparkes-johnson-1.1.2.5 test/johnson/generic/conversions/thread_test.rb
smparkes-johnson-1.1.2.4 test/johnson/generic/conversions/thread_test.rb
smparkes-johnson-1.1.2.3 test/johnson/generic/conversions/thread_test.rb