summaryrefslogtreecommitdiff
path: root/spec/ruby/library/weakref/new_spec.rb
blob: 6290e61fe39ad7f02d71d16b6f1babd054e30e5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
require_relative '../../spec_helper'
require 'weakref'

describe "WeakRef#new" do
  it "creates a subclass correctly" do
    wr2 = Class.new(WeakRef) {
      def __getobj__
        :dummy
      end
    }
    wr2.new(Object.new).__getobj__.should == :dummy
  end
end