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..4d0fb34fc8 --- /dev/null +++ b/spec/ruby/core/unboundmethod/name_spec.rb @@ -0,0 +1,15 @@ +require_relative '../../spec_helper' +require_relative 'fixtures/classes' + +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 |
