summaryrefslogtreecommitdiff
path: root/spec/ruby/core/module/const_defined_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/module/const_defined_spec.rb')
-rw-r--r--spec/ruby/core/module/const_defined_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/ruby/core/module/const_defined_spec.rb b/spec/ruby/core/module/const_defined_spec.rb
index 0673adca3d..75730395e8 100644
--- a/spec/ruby/core/module/const_defined_spec.rb
+++ b/spec/ruby/core/module/const_defined_spec.rb
@@ -40,6 +40,11 @@ describe "Module#const_defined?" do
ConstantSpecs::ContainerA::ChildA.const_defined?(:CS_CONST4, true).should be_true
end
+ it "coerces the inherit flag to a boolean" do
+ ConstantSpecs::ContainerA::ChildA.const_defined?(:CS_CONST4, nil).should be_false
+ ConstantSpecs::ContainerA::ChildA.const_defined?(:CS_CONST4, :true).should be_true
+ end
+
it "returns true if the given String names a constant defined in the receiver" do
ConstantSpecs.const_defined?("CS_CONST2").should == true
ConstantSpecs.const_defined?("ModuleA").should == true