Sha256: 5aeba2fccdb3902b66e7abe5dcce23d79da176f159a7feb42fe84449e1609612
Contents?: true
Size: 1.16 KB
Versions: 52
Compression:
Stored size: 1.16 KB
Contents
require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../fixtures/classes', __FILE__) describe "Module#name" do ruby_version_is ""..."1.9" do it "returns an empty String by default" do Module.new.name.should == "" Class.new.name.should == "" end end ruby_version_is "1.9" do it "returns nil by default" do Module.new.name.should be_nil Class.new.name.should be_nil end require File.expand_path('../fixtures/name', __FILE__) # http://redmine.ruby-lang.org/issues/show/1833 it "preserves the encoding in which the class was defined" do ModuleSpecs::NameEncoding.new.name.encoding.should == Encoding::UTF_8 end end it "returns the name of self" do ModuleSpecs.name.should == "ModuleSpecs" ModuleSpecs::Child.name.should == "ModuleSpecs::Child" ModuleSpecs::Parent.name.should == "ModuleSpecs::Parent" ModuleSpecs::Basic.name.should == "ModuleSpecs::Basic" ModuleSpecs::Super.name.should == "ModuleSpecs::Super" begin (ModuleSpecs::X = Module.new).name.should == "ModuleSpecs::X" ensure ModuleSpecs.send :remove_const, :X end end end
Version data entries
52 entries across 52 versions & 2 rubygems