diff options
Diffstat (limited to 'spec/ruby/core/module/const_set_spec.rb')
-rw-r--r-- | spec/ruby/core/module/const_set_spec.rb | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/spec/ruby/core/module/const_set_spec.rb b/spec/ruby/core/module/const_set_spec.rb index b537d3f133..5bdfd7b68f 100644 --- a/spec/ruby/core/module/const_set_spec.rb +++ b/spec/ruby/core/module/const_set_spec.rb @@ -20,20 +20,10 @@ describe "Module#const_set" do m.name.should == "ConstantSpecs::CS_CONST1000" end - ruby_version_is ""..."3.0" do - it "does not set the name of a module scoped by an anonymous module" do - a, b = Module.new, Module.new - a.const_set :B, b - b.name.should be_nil - end - end - - ruby_version_is "3.0" do - it "sets the name of a module scoped by an anonymous module" do - a, b = Module.new, Module.new - a.const_set :B, b - b.name.should.end_with? '::B' - end + it "sets the name of a module scoped by an anonymous module" do + a, b = Module.new, Module.new + a.const_set :B, b + b.name.should.end_with? '::B' end it "sets the name of contained modules when assigning a toplevel anonymous module" do @@ -101,7 +91,7 @@ describe "Module#const_set" do mod.const_get(:Foo).should == 1 end - it "does not warn if the previous value was undefined" do + it "does not warn after a failed autoload" do path = fixture(__FILE__, "autoload_o.rb") ScratchPad.record [] mod = Module.new @@ -109,7 +99,6 @@ describe "Module#const_set" do mod.autoload :Foo, path -> { mod::Foo }.should raise_error(NameError) - mod.should have_constant(:Foo) mod.const_defined?(:Foo).should == false mod.autoload?(:Foo).should == nil |