mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
Ruby: Add test case for view without ERB template
This commit is contained in:
committed by
Tom Hvitved
parent
803513acc6
commit
4cfdf8b7a3
@@ -16,4 +16,10 @@ class App
|
||||
view = View3.new(x)
|
||||
render(view)
|
||||
end
|
||||
|
||||
def run4
|
||||
x = source(5)
|
||||
view = View4.new(x)
|
||||
render(view)
|
||||
end
|
||||
end
|
||||
|
||||
15
ruby/ql/test/library-tests/dataflow/erb/view4.rb
Normal file
15
ruby/ql/test/library-tests/dataflow/erb/view4.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
# This component has no corresponding template file, because it defines a `call` method instead.
|
||||
|
||||
class View4 < ViewComponent::Base
|
||||
def initialize(x)
|
||||
@x = x
|
||||
end
|
||||
|
||||
def get
|
||||
@x
|
||||
end
|
||||
|
||||
def call
|
||||
"hi"
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user