2014-12-12 13:48:57 +03:00
|
|
|
# -*- coding: us-ascii -*-
|
2015-12-16 08:07:31 +03:00
|
|
|
# frozen_string_literal: false
|
2014-12-12 13:48:57 +03:00
|
|
|
require 'test/unit'
|
|
|
|
|
|
|
|
class TestErbCommand < Test::Unit::TestCase
|
|
|
|
def test_var
|
2022-11-03 08:53:39 +03:00
|
|
|
pend if RUBY_ENGINE == 'truffleruby'
|
2022-11-25 01:35:28 +03:00
|
|
|
assert_in_out_err(["-I#{File.expand_path('../../lib', __dir__)}",
|
2021-01-20 11:46:32 +03:00
|
|
|
File.expand_path("../../libexec/erb", __dir__),
|
2014-12-12 13:48:57 +03:00
|
|
|
"var=hoge"],
|
|
|
|
"<%=var%>", ["hoge"])
|
|
|
|
end
|
2017-11-10 16:59:01 +03:00
|
|
|
|
|
|
|
def test_template_file_encoding
|
2022-11-03 08:53:39 +03:00
|
|
|
pend if RUBY_ENGINE == 'truffleruby'
|
2022-11-25 01:35:28 +03:00
|
|
|
assert_in_out_err(["-I#{File.expand_path('../../lib', __dir__)}",
|
2021-01-20 11:46:32 +03:00
|
|
|
File.expand_path("../../libexec/erb", __dir__)],
|
2017-11-10 16:59:01 +03:00
|
|
|
"<%=''.encoding.to_s%>", ["UTF-8"])
|
|
|
|
end
|
2014-12-12 13:48:57 +03:00
|
|
|
end
|