summaryrefslogtreecommitdiff
path: root/spec/ruby/core/module/constants_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/module/constants_spec.rb')
-rw-r--r--spec/ruby/core/module/constants_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/ruby/core/module/constants_spec.rb b/spec/ruby/core/module/constants_spec.rb
index fe95143872..330da1cc88 100644
--- a/spec/ruby/core/module/constants_spec.rb
+++ b/spec/ruby/core/module/constants_spec.rb
@@ -74,6 +74,12 @@ describe "Module#constants" do
it "returns only public constants" do
ModuleSpecs::PrivConstModule.constants.should == [:PUBLIC_CONSTANT]
end
+
+ it "returns only constants starting with an uppercase letter" do
+ # e.g. fatal, IO::generic_readable and IO::generic_writable should not be returned by Module#constants
+ Object.constants.each { |c| c[0].should == c[0].upcase }
+ IO.constants.each { |c| c[0].should == c[0].upcase }
+ end
end
describe "Module#constants" do