From b6536a90db6200df96a8bcea432e71e083fb79f7 Mon Sep 17 00:00:00 2001 From: Laurent Sansonetti Date: Mon, 21 Apr 2014 19:12:15 +0200 Subject: [PATCH] add rubymotion/proc spec, test for java.lang.Runnable functionality --- test/test-android/app/rubymotion/proc_spec.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 test/test-android/app/rubymotion/proc_spec.rb diff --git a/test/test-android/app/rubymotion/proc_spec.rb b/test/test-android/app/rubymotion/proc_spec.rb new file mode 100644 index 00000000..514c645e --- /dev/null +++ b/test/test-android/app/rubymotion/proc_spec.rb @@ -0,0 +1,15 @@ +describe "Procs" do + it "are based on com.rubymotion.Proc" do + obj = Proc.new {} + obj.class.should == Proc + obj.class.getName.should == 'com.rubymotion.Proc' + end + + it "can be passed to Java methods expecting a java.lang.Runnable" do + $proc_runnable_ok = false + thr = Java::Lang::Thread.new -> { $proc_runnable_ok = true } + thr.start + thr.join + $proc_runnable_ok.should be_true + end +end