Renamed method

This commit is contained in:
Jari Bakken 2010-05-13 16:04:01 +02:00
parent 8b11853fbf
commit 2c3ec3d6e9
2 changed files with 11 additions and 3 deletions

View File

@ -59,8 +59,15 @@ module ICU
UCharPointer.from_string(b), b.length)
end
# can't override Object#equal? - suggestions welcome
def same?(a, b)
def equal?(*args)
return super() if args.empty?
if args.size != 2
raise ArgumentError, "wrong number of arguments (#{args.size} for 2)"
end
a, b = args
Lib.ucol_equal(@c, UCharPointer.from_string(a), a.length,
UCharPointer.from_string(b), b.length)
end

View File

@ -43,7 +43,8 @@ module ICU
end
it "should know if a string is equal to another" do
@c.should be_same("a", "a")
@c.should be_equal("a", "a")
@c.should_not be_equal("a", "b")
end
end