add aliases for Mysql compatibility
This commit is contained in:
parent
ae6c33a13f
commit
98fbeb6f64
@ -7,5 +7,9 @@ module Mysql2
|
|||||||
@error_number = nil
|
@error_number = nil
|
||||||
@sql_state = nil
|
@sql_state = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Mysql gem compatibility
|
||||||
|
alias_method :errno, :error_number
|
||||||
|
alias_method :error, :message
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -13,4 +13,13 @@ describe Mysql2::Error do
|
|||||||
it "should respond to #sql_state" do
|
it "should respond to #sql_state" do
|
||||||
@error.should respond_to(:sql_state)
|
@error.should respond_to(:sql_state)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Mysql gem compatibility
|
||||||
|
it "should alias #error_number to #errno" do
|
||||||
|
@error.should respond_to(:errno)
|
||||||
|
end
|
||||||
|
|
||||||
|
it "should alias #message to #error" do
|
||||||
|
@error.should respond_to(:error)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user