2017-11-12 02:10:03 +00:00
|
|
|
Before:
|
2018-07-15 17:24:53 +00:00
|
|
|
call ale#assert#SetUpLinterTest('eruby', 'erb')
|
2017-11-12 02:10:03 +00:00
|
|
|
|
|
|
|
After:
|
2018-07-15 17:24:53 +00:00
|
|
|
call ale#assert#TearDownLinterTest()
|
2017-11-12 02:10:03 +00:00
|
|
|
|
|
|
|
Execute(Executable should not contain any filter code by default):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/ruby/not_a_rails_app/file.rb')
|
2017-11-12 02:10:03 +00:00
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter 'erb', 'erb -P -T - -x %t | ruby -c'
|
2017-11-12 02:10:03 +00:00
|
|
|
|
|
|
|
Execute(Executable should filter invalid eRuby when inside a Rails project):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/ruby/valid_rails_app/app/views/my_great_view.html.erb')
|
2017-11-12 02:10:03 +00:00
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter 'erb',
|
2023-05-26 05:52:51 +00:00
|
|
|
\ 'ruby -r erb -e ' . ale#Escape('puts ERB.new($stdin.read.gsub(%{<%=},%{<%}), trim_mode: %{-}).src') . '< %t | ruby -c'
|