Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* JRUBY-6334 Added specs for the current behavor of master

  • Loading branch information...
commit 43e91ddcdb05f994cfd7ae1e35744c94c36cddd8 1 parent dae852c
@donv donv authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 spec/java_integration/object/java_import_spec.rb
View
16 spec/java_integration/object/java_import_spec.rb
@@ -0,0 +1,16 @@
+require 'java'
+
+describe "An object wanting to import Java classes" do
+ it "should explode when trying to import a non-existant Java class" do
+ lambda{ java_import 'does.not.Exist' }.should raise_error(NameError)
+ end
+
+ it "should receive an array with the imported classes" do
+ java_import().should == []
+ java_import('java.util.Hashtable').should == [java.util.Hashtable]
+
+ imported_classes = java_import('java.util.Hashtable', java.util.Hashtable, Java::java.util.Hashtable, Java::JavaUtil::Hashtable)
+ imported_classes.should == [java.util.Hashtable] * 4
+ end
+end
+
Please sign in to comment.
Something went wrong with that request. Please try again.