summaryrefslogtreecommitdiff
path: root/spec/ruby/optional/capi/fixtures
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/optional/capi/fixtures')
-rw-r--r--spec/ruby/optional/capi/fixtures/class.rb24
-rw-r--r--spec/ruby/optional/capi/fixtures/kernel.rb19
-rw-r--r--spec/ruby/optional/capi/fixtures/module.rb4
-rw-r--r--spec/ruby/optional/capi/fixtures/object.rb29
-rw-r--r--spec/ruby/optional/capi/fixtures/read.txt1
5 files changed, 76 insertions, 1 deletions
diff --git a/spec/ruby/optional/capi/fixtures/class.rb b/spec/ruby/optional/capi/fixtures/class.rb
index de824b3ab0..b463e3b4c3 100644
--- a/spec/ruby/optional/capi/fixtures/class.rb
+++ b/spec/ruby/optional/capi/fixtures/class.rb
@@ -15,6 +15,16 @@ class CApiClassSpecs
end
end
+ class KeywordAlloc
+ attr_reader :initialized, :args, :kwargs
+
+ def initialize(*args, **kwargs)
+ @initialized = true
+ @args = args
+ @kwargs = kwargs
+ end
+ end
+
class Attr
def initialize
@foo, @bar, @baz = 1, 2, 3
@@ -68,15 +78,27 @@ class CApiClassSpecs
class SubSub < Sub
def call_super_method
- :subclass_method
+ :subsubclass_method
+ end
+ end
+
+ class SuperSelf
+ def call_super_method
+ self
end
end
+ class SubSelf < SuperSelf
+ end
+
class A
C = 1
autoload :D, File.expand_path('../path_to_class.rb', __FILE__)
class B
end
+
+ module M
+ end
end
end
diff --git a/spec/ruby/optional/capi/fixtures/kernel.rb b/spec/ruby/optional/capi/fixtures/kernel.rb
new file mode 100644
index 0000000000..d3fc7c57e8
--- /dev/null
+++ b/spec/ruby/optional/capi/fixtures/kernel.rb
@@ -0,0 +1,19 @@
+class CApiKernelSpecs
+ class ClassWithPublicMethod
+ def public_method(*, **)
+ :public
+ end
+ end
+
+ class ClassWithPrivateMethod
+ private def private_method(*, **)
+ :private
+ end
+ end
+
+ class ClassWithProtectedMethod
+ protected def protected_method(*, **)
+ :protected
+ end
+ end
+end
diff --git a/spec/ruby/optional/capi/fixtures/module.rb b/spec/ruby/optional/capi/fixtures/module.rb
index ba90eb7181..aac8bfbfb3 100644
--- a/spec/ruby/optional/capi/fixtures/module.rb
+++ b/spec/ruby/optional/capi/fixtures/module.rb
@@ -13,6 +13,10 @@ class CApiModuleSpecs
autoload :D, File.expand_path('../const_get.rb', __FILE__)
X = 1
+ Q = 1
+ R = 2
+ S = 3
+ T = 5
end
class B < A
diff --git a/spec/ruby/optional/capi/fixtures/object.rb b/spec/ruby/optional/capi/fixtures/object.rb
new file mode 100644
index 0000000000..a59f2309d8
--- /dev/null
+++ b/spec/ruby/optional/capi/fixtures/object.rb
@@ -0,0 +1,29 @@
+class CApiObjectSpecs
+ class IVars
+ def initialize
+ @a = 3
+ @b = 7
+ @c = 4
+ end
+
+ def self.set_class_variables
+ @@foo = :a
+ @@bar = :b
+ @@baz = :c
+ end
+ end
+
+ module MVars
+ @@mvar = :foo
+ @@mvar2 = :bar
+
+ @ivar = :baz
+ end
+
+ module CVars
+ @@cvar = :foo
+ @@cvar2 = :bar
+
+ @ivar = :baz
+ end
+end
diff --git a/spec/ruby/optional/capi/fixtures/read.txt b/spec/ruby/optional/capi/fixtures/read.txt
new file mode 100644
index 0000000000..f7065a35d0
--- /dev/null
+++ b/spec/ruby/optional/capi/fixtures/read.txt
@@ -0,0 +1 @@
+fixture file contents to test read() with RSTRING_PTR