Generate a Unicode nonbreaking space in Ruby
Regular spaces and non-breaking spaces are hard to distinguish for a human.
Instead of using the
HTML entity or code like
" " # this is an nbsp, use a well-named helper method instead.
def nbsp .pack('U*') end
160 is the ASCII character code of a non-breaking space.
Flaky tests are tests that sometimes fail for no obvious reason. They are the plague of many end-to-end (E2E) test suites that automate the browser through tools like Capybara and Selenium.
Join our free training event and learn to fix any flaky test suite, even in large legacy applications.