mirror of https://github.com/erickguan/ffi-icu.git
Renamed method
This commit is contained in:
parent
8b11853fbf
commit
2c3ec3d6e9
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue