Files
RubyMotion/test/test-android/app/rubymotion/java_annotation_spec.rb
Laurent Sansonetti 9cf9688b1e pre is now 3.2
2014-10-04 12:21:37 +02:00

19 lines
506 B
Ruby

class Java_Annotation_Test < Java::Lang::Object
__annotation__('@android.webkit.JavascriptInterface')
def foo
42
end
end
describe "Java annotations" do
it "can be attached to Ruby methods using the __annotation__() class method" do
=begin
method = Java_Annotation_Test.getMethod('foo', [])
method.should != nil
annotations = method.getDeclaredAnnotations
annotations.size.should == 1
annotations[0].toString.should == '@android.webkit.JavascriptInterface()'
=end
end
end