diff options
Diffstat (limited to 'spec/ruby/language')
-rw-r--r-- | spec/ruby/language/module_spec.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/spec/ruby/language/module_spec.rb b/spec/ruby/language/module_spec.rb index 1a5fcaf46f..e361bf58f5 100644 --- a/spec/ruby/language/module_spec.rb +++ b/spec/ruby/language/module_spec.rb @@ -28,9 +28,18 @@ describe "The module keyword" do ModuleSpecs::Reopened.should be_true end - it "reopens a module included in Object" do - module IncludedModuleSpecs; Reopened = true; end - ModuleSpecs::IncludedInObject::IncludedModuleSpecs::Reopened.should be_true + ruby_version_is '3.2' do + it "does not reopen a module included in Object" do + module IncludedModuleSpecs; Reopened = true; end + ModuleSpecs::IncludedInObject::IncludedModuleSpecs.should_not == Object::IncludedModuleSpecs + end + end + + ruby_version_is ''...'3.2' do + it "reopens a module included in Object" do + module IncludedModuleSpecs; Reopened = true; end + ModuleSpecs::IncludedInObject::IncludedModuleSpecs::Reopened.should be_true + end end it "raises a TypeError if the constant is a Class" do |