mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-01 17:39:54 +08:00
add spec to relate alias/alias_method
This commit is contained in:
19
test/test/spec/alias_spec.rb
Normal file
19
test/test/spec/alias_spec.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
class AliasSpec
|
||||
attr_accessor :value
|
||||
def initialize
|
||||
@value = 42
|
||||
end
|
||||
|
||||
class << self
|
||||
alias :foo :new
|
||||
alias_method :bar, :new
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
describe "alias/alias_method" do
|
||||
it "should work on new method" do
|
||||
# RM-56 Can't use alias or alias_method on new method
|
||||
AliasSpec.foo.value.should == AliasSpec.bar.value
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user