Sha256: 635e213fcce986a528674c96bf5596d060051508ef672c0cd040bf9f885ba11b
Contents?: true
Size: 636 Bytes
Versions: 83
Compression:
Stored size: 636 Bytes
Contents
require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/../../spec_helper' describe "Class#new" do it "returns a new instance of self" do klass = Class.new klass.new.is_a?(klass).should == true end it "invokes #initialize on the new instance with the given args" do klass = Class.new do def initialize(*args) @initialized = true @args = args end def args @args end def initialized? @initialized || false end end klass.new.initialized?.should == true klass.new(1, 2, 3).args.should == [1, 2, 3] end end
Version data entries
83 entries across 83 versions & 1 rubygems