Fix for JRUBY-2882. Handle error messages related to constructors better
[jruby.git] / spec / java_integration / methods / error_spec.rb
blob9885dddb71ac62d49295ef407d46310cf9dae89f
1 require File.dirname(__FILE__) + "/../spec_helper"
3 describe "Java invocation errors" do
4   describe "(calling constructor)" do 
5     it "should fail correctly when called with wrong parameters" do 
6       proc do 
7         java.util.HashMap.new "str"
8       end.should raise_error(NameError)
9     end
10   end
11   
12   describe "(calling instance method)" do 
13     it "should fail correctly when called with wrong parameters" do 
14       proc do 
15         java.util.ArrayList.new.add_all "str"
16       end.should raise_error(NameError)
17     end
18   end
19 end