Great to see these changes! Mostly looks good. The tests are quite clean 
overall. I do have some comments/questions... Btw, I assume you have run all 
the new specs against MRI to make sure they are correct. If not, please do run 
them with MRI.


Should the MutableString argument of CreateDigest be marked as DefaultProtocol? 
Either way, is there a spec for this case? Same with all other APIs. You do use 
MutableString in some places, you might have thought about it explicitly. Just 
checking.

In "public static int/*!*/ Seed(Digest/*!*/ self)", You don't have to use /*!*/ 
with valuetypes like int, since they can never be null.

You can use MutableString.CreateEmpty instead of MutableString.Create("");.

You use "_certificate.Handle.ToInt32() == 0". This will behave incorrectly on 
64-bits if the lower 32 bits of the pointer happen to be 0. Can't you compare 
with IntPtr.Zero? You can even add an extension

TESTS
-------

Is it possible to add a test that Digest.new does not call Digest#initialize?

For "x509_cert.subject.should == """, I think you can write it as 
"x509_cert.subject.should be_empty"

In issuer_spec.rb, you have "(@x509_cert.issuer = n).should equal(n)". This is 
not testing the right thing as shown by this example. Call the method issuer= 
directly like "(@x509_cert.issuer=(n).should equal(n)" instead. Same with 
"(@x509_cert.not_before = n).should equal(n)" and a few other places.
class C
 def foo=(v) "Return value" end
end
puts (C.new.foo = 1) # prints 1, not "Return value"

In version_spec.rb, I think you should use to_int instead of to_i in "m = 
mock(10).should_not_receive(:to_i)", but I am not 100% sure.

Thanks,
Shri

From: [email protected] 
[mailto:[email protected]] On Behalf Of Jirapong Nanta
Sent: Thursday, July 23, 2009 6:14 PM
To: ironruby-core
Subject: [Ironruby-core] OpenSSL::X509::Certificate + rubyspecs

Hi,
   I'm trying to get all my rubyspecs for openssl back to current repos.

 *   new rubyspecs for x509::Certificate; 
new,issuer,public_key,version,serial,subject
 *   new rubyspecs for x509::Name
 *   new rubyspecs for PKey::RSA
 *   implement x509::Certificate.new and get methods for 
issuer,subject,public_key,serial,and version
 *   tagged the fails rubyspes

http://github.com/Jirapong/ironruby/commit/40ddbcb700e402a43ad387cf69005a0795a033fb

Thank you,
-Jirapong
_______________________________________________
Ironruby-core mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core

Reply via email to