Skip to content

Commit

Permalink
Ensure that tests work with --enable-frozen-string-literal
Browse files Browse the repository at this point in the history
Adjust the RUBYOPT variable before running the tests.
export RUBYOPT=--enable-frozen-string-literal
  • Loading branch information
minad committed Apr 23, 2023
1 parent c8332b3 commit e1b66cc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/core/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def call_macro(name, *args)
end

def hello_world(text = "Hello World from @env", opts = {})
text << opts.to_a * " " if opts.any?
text = text + (opts.to_a * " ") if opts.any?
if block_given?
"#{text} #{yield} #{text}"
else
Expand Down
4 changes: 2 additions & 2 deletions test/core/test_encoding.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ def test_windows_crlf
end

def test_binary
source = "| \xFF\xFF"
source = "| \xFF\xFF".dup
source.force_encoding(Encoding::BINARY)

result = "\xFF\xFF"
result = "\xFF\xFF".dup
result.force_encoding(Encoding::BINARY)

out = render(source, default_encoding: 'binary')
Expand Down
2 changes: 1 addition & 1 deletion test/literate/run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def on_slim(code)
def on_html(code)
raise Temple::FilterError, 'Html block must be preceded by slim block' unless @in_testcase
@in_testcase = false
result = " html = #{code.inspect}\n"
result = " html = #{code.inspect}\n".dup
if @opts.empty?
result << " _(render(slim)).must_equal html\nend\n"
else
Expand Down

0 comments on commit e1b66cc

Please sign in to comment.