add rubymotion/proc spec, test for java.lang.Runnable functionality

This commit is contained in:
Laurent Sansonetti
2014-04-21 19:12:15 +02:00
parent 0fe97bc9d2
commit b6536a90db

View File

@@ -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