Skip to content

Commit

Permalink
fix typo in test
Browse files Browse the repository at this point in the history
  • Loading branch information
SamSaffron committed Jan 9, 2025
1 parent d43620a commit 344588c
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions test/mini_racer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1077,15 +1077,14 @@ def test_regexp_string_iterator
def test_function_cloning
message = nil
context = MiniRacer::Context.new
context.attach("rails.logger.warn", proc { |msg| message = msg })
context.attach("log", proc { |msg| message = msg })
context.eval <<~JS
console = {
prefix: "[PrettyText] ",
log: function(...args){ rails.logger.info(console.prefix + args.join(" ")); },
}
JS
console = {
log: function(...args){ log(args.join(" ")); },
}
JS

context.eval("console.log('Hello', 'World!')")
assert_equal "[PrettyText] Hello World!", message
assert_equal "Hello World!", message
end
end

0 comments on commit 344588c

Please sign in to comment.