Sha256: 5fc5bbc56692bea3aeb742e73d5fd33f7de2b1233ef25e43fcf1a784cd04d91a

Contents?: true

Size: 477 Bytes

Versions: 3

Compression:

Stored size: 477 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper'

describe Class do
  describe "#declared_methods" do
    it "returns all defined and inherited methods but not defined in the Object" do
      class First
        attr_accessor :foo
        def to_s; end
      end

      class Second < First
        attr_reader :bar
      end

      First.declared_methods.should =~ [:foo, :foo=, :to_s]
      Second.declared_methods.should =~ [:bar, :foo, :foo=, :to_s]
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mustang-0.2.2 spec/mustang/core_ext/class_spec.rb
mustang-0.2.1 spec/mustang/core_ext/class_spec.rb
mustang-0.2.0 spec/mustang/core_ext/class_spec.rb