diff options
Diffstat (limited to 'spec/ruby/core/unboundmethod/name_spec.rb')
-rw-r--r-- | spec/ruby/core/unboundmethod/name_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/ruby/core/unboundmethod/name_spec.rb b/spec/ruby/core/unboundmethod/name_spec.rb new file mode 100644 index 0000000000..c4602d529a --- /dev/null +++ b/spec/ruby/core/unboundmethod/name_spec.rb @@ -0,0 +1,15 @@ +require File.expand_path('../../../spec_helper', __FILE__) +require File.expand_path('../fixtures/classes', __FILE__) + +describe "UnboundMethod#name" do + it "returns the name of the method" do + String.instance_method(:upcase).name.should == :upcase + end + + it "returns the name even when aliased" do + obj = UnboundMethodSpecs::Methods.new + obj.method(:foo).unbind.name.should == :foo + obj.method(:bar).unbind.name.should == :bar + UnboundMethodSpecs::Methods.instance_method(:bar).name.should == :bar + end +end |