Skip to content

Commit

Permalink
Add testing code for redefined
Browse files Browse the repository at this point in the history
  • Loading branch information
ksss committed Nov 1, 2023
1 parent 953a2c6 commit 71fd0e9
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/rbs/runtime_prototype_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -907,4 +907,30 @@ def members: () -> [ :foo, :bar ]
end
end
end

class Redefined
def self.constants = raise
def class = raise
end

def test_reflection
SignatureManager.new do |manager|
manager.build do |env|
p = Runtime.new(patterns: ["RBS::RuntimePrototypeTest::Redefined"], env: env, merge: false)
assert_write p.decls, <<~RBS
module RBS
class RuntimePrototypeTest < ::Test::Unit::TestCase
class Redefined
def self.constants: () -> untyped
public
def class: () -> untyped
end
end
end
RBS
end
end
end
end

0 comments on commit 71fd0e9

Please sign in to comment.