mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-13 09:40:32 +08:00
add rubymotion/proc spec, test for java.lang.Runnable functionality
This commit is contained in:
15
test/test-android/app/rubymotion/proc_spec.rb
Normal file
15
test/test-android/app/rubymotion/proc_spec.rb
Normal 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
|
||||
Reference in New Issue
Block a user