summaryrefslogtreecommitdiff
path: root/spec/ruby/optional/capi/constants_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/optional/capi/constants_spec.rb')
-rw-r--r--spec/ruby/optional/capi/constants_spec.rb105
1 files changed, 86 insertions, 19 deletions
diff --git a/spec/ruby/optional/capi/constants_spec.rb b/spec/ruby/optional/capi/constants_spec.rb
index 11a328a91f..74584690ad 100644
--- a/spec/ruby/optional/capi/constants_spec.rb
+++ b/spec/ruby/optional/capi/constants_spec.rb
@@ -11,24 +11,42 @@ describe "C-API constant" do
@s.rb_cArray.should == Array
end
+ specify "rb_cBasicObject references the BasicObject class" do
+ @s.rb_cBasicObject.should == BasicObject
+ end
+
+ specify "rb_cBinding references the Binding class" do
+ @s.rb_cBinding.should == Binding
+ end
+
specify "rb_cClass references the Class class" do
@s.rb_cClass.should == Class
end
+ specify "rb_cComplex references the Complex class" do
+ @s.rb_cComplex.should == Complex
+ end
+
specify "rb_mComparable references the Comparable module" do
@s.rb_mComparable.should == Comparable
end
- ruby_version_is ""..."2.5" do
- specify "rb_cData references the Data class" do
- @s.rb_cData.should == Data
- end
+ specify "rb_cDir references the Dir class" do
+ @s.rb_cDir.should == Dir
+ end
+
+ specify "rb_cEncoding references the Encoding class" do
+ @s.rb_cEncoding.should == Encoding
end
specify "rb_mEnumerable references the Enumerable module" do
@s.rb_mEnumerable.should == Enumerable
end
+ specify "rb_cEnumerator references the Enumerator class" do
+ @s.rb_cEnumerator.should == Enumerator
+ end
+
specify "rb_cFalseClass references the FalseClass class" do
@s.rb_cFalseClass.should == FalseClass
end
@@ -37,10 +55,18 @@ describe "C-API constant" do
@s.rb_cFile.should == File
end
+ specify "rb_mFileTest references the FileTest module" do
+ @s.rb_mFileTest.should == FileTest
+ end
+
specify "rb_cFloat references the Float class" do
@s.rb_cFloat.should == Float
end
+ specify "rb_mGC references the GC module" do
+ @s.rb_mGC.should == GC
+ end
+
specify "rb_cHash references the Hash class" do
@s.rb_cHash.should == Hash
end
@@ -57,10 +83,18 @@ describe "C-API constant" do
@s.rb_mKernel.should == Kernel
end
+ specify "rb_mMath references the Math module" do
+ @s.rb_mMath.should == Math
+ end
+
specify "rb_cMatch references the MatchData class" do
@s.rb_cMatch.should == MatchData
end
+ specify "rb_cMethod references the Method class" do
+ @s.rb_cMethod.should == Method
+ end
+
specify "rb_cModule references the Module class" do
@s.rb_cModule.should == Module
end
@@ -77,14 +111,34 @@ describe "C-API constant" do
@s.rb_cObject.should == Object
end
+ specify "rb_cProc references the Proc class" do
+ @s.rb_cProc.should == Proc
+ end
+
+ specify "rb_mProcess references the Process module" do
+ @s.rb_mProcess.should == Process
+ end
+
+ specify "rb_cRandom references the Random class" do
+ @s.rb_cRandom.should == Random
+ end
+
specify "rb_cRange references the Range class" do
@s.rb_cRange.should == Range
end
+ specify "rb_cRational references the Rational class" do
+ @s.rb_cRational.should == Rational
+ end
+
specify "rb_cRegexp references the Regexp class" do
@s.rb_cRegexp.should == Regexp
end
+ specify "rb_cStat references the File::Stat class" do
+ @s.rb_cStat.should == File::Stat
+ end
+
specify "rb_cString references the String class" do
@s.rb_cString.should == String
end
@@ -109,18 +163,9 @@ describe "C-API constant" do
@s.rb_cTrueClass.should == TrueClass
end
- specify "rb_cProc references the Proc class" do
- @s.rb_cProc.should == Proc
- end
-
- specify "rb_cMethod references the Method class" do
- @s.rb_cMethod.should == Method
- end
-
- specify "rb_cDir references the Dir class" do
- @s.rb_cDir.should == Dir
+ specify "rb_cUnboundMethod references the UnboundMethod class" do
+ @s.rb_cUnboundMethod.should == UnboundMethod
end
-
end
describe "C-API exception constant" do
@@ -132,6 +177,14 @@ describe "C-API exception constant" do
@s.rb_eArgError.should == ArgumentError
end
+ specify "rb_eEncodingError references the EncodingError class" do
+ @s.rb_eEncodingError.should == EncodingError
+ end
+
+ specify "rb_eEncCompatError references the Encoding::CompatibilityError" do
+ @s.rb_eEncCompatError.should == Encoding::CompatibilityError
+ end
+
specify "rb_eEOFError references the EOFError class" do
@s.rb_eEOFError.should == EOFError
end
@@ -144,10 +197,20 @@ describe "C-API exception constant" do
@s.rb_eException.should == Exception
end
+ specify "rb_eFatal references the fatal class" do
+ fatal = @s.rb_eFatal
+ fatal.should.is_a?(Class)
+ fatal.should < Exception
+ end
+
specify "rb_eFloatDomainError references the FloatDomainError class" do
@s.rb_eFloatDomainError.should == FloatDomainError
end
+ specify "rb_eFrozenError references the FrozenError class" do
+ @s.rb_eFrozenError.should == FrozenError
+ end
+
specify "rb_eIndexError references the IndexError class" do
@s.rb_eIndexError.should == IndexError
end
@@ -160,6 +223,10 @@ describe "C-API exception constant" do
@s.rb_eIOError.should == IOError
end
+ specify "rb_eKeyError references the KeyError class" do
+ @s.rb_eKeyError.should == KeyError
+ end
+
specify "rb_eLoadError references the LoadError class" do
@s.rb_eLoadError.should == LoadError
end
@@ -172,10 +239,6 @@ describe "C-API exception constant" do
@s.rb_eMathDomainError.should == Math::DomainError
end
- specify "rb_eEncCompatError references the Encoding::CompatibilityError" do
- @s.rb_eEncCompatError.should == Encoding::CompatibilityError
- end
-
specify "rb_eNameError references the NameError class" do
@s.rb_eNameError.should == NameError
end
@@ -220,6 +283,10 @@ describe "C-API exception constant" do
@s.rb_eStandardError.should == StandardError
end
+ specify "rb_eStopIteration references the StopIteration class" do
+ @s.rb_eStopIteration.should == StopIteration
+ end
+
specify "rb_eSyntaxError references the SyntaxError class" do
@s.rb_eSyntaxError.should == SyntaxError
end