given this csharp class:
public class CSharpClass
{
public int MyInteger { get; set;}
public double MyDouble { get; set; }
public string MyString { get; set;}
public int? MyNullableInt { get; set; }
public decimal MyDecimal { get; set; }
}
I should be able to write a test as simple as in IronRuby:
it "should be able to check a string is equal" do
k = CSharpClass.new
k.my_string = "this is my string"
k.my_string.should == "this is my string"
end
currently a .to_str is required for this to work
k.my_string.to_str.should == "this is my string"
Adding the below overload to StringOps.cs makes this work but likely isn't the *right* way to handle this.
[RubyMethod("===", RubyMethodAttributes.PublicInstance)]
[RubyMethod("==", RubyMethodAttributes.PublicInstance)]
public static bool Equals(string str, MutableString other) {
return str.Equals(other.ToString());
}
I also came across a post [1] saying that this was discussed on the mailing list and would be fixed "later"
but I couldn't find the thread via google.
[1] http://rubydoes.net/2008/02/21/testing-net-with-ironrubys-mini_rspecrb/ |