Skip to content

Commit 8b5e05f

Browse files
committed
Add test for multiple constants.
1 parent 9fefdc6 commit 8b5e05f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

spec/ruby/optional/capi/fixtures/module.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ class A
1313
autoload :D, File.expand_path('../const_get.rb', __FILE__)
1414

1515
X = 1
16+
Q = 1
17+
R = 2
18+
S = 3
19+
T = 5
1620
end
1721

1822
class B < A

spec/ruby/optional/capi/module_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@
134134
@m.rb_const_get(CApiModuleSpecs::A, :X).should == 1
135135
end
136136

137+
it "returns a constant defined in the module for multiple constants" do
138+
[:Q, :R, :S, :T].each { |x| @m.rb_const_get(CApiModuleSpecs::A, x).should == CApiModuleSpecs::A.const_get(x) }
139+
end
140+
137141
it "returns a constant defined at toplevel" do
138142
@m.rb_const_get(CApiModuleSpecs::A, :Integer).should == Integer
139143
end

0 commit comments

Comments
 (0)