File: test_helper.rb

package info (click to toggle)
ruby-rails-dom-testing 2.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 164 kB
  • sloc: ruby: 1,105; makefile: 4
file content (23 lines) | stat: -rw-r--r-- 505 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

require "rails-dom-testing"
require "active_support/test_case"
require "minitest/autorun"

ActiveSupport::TestCase.test_order = :random

module DomTestingHelpers
  def jruby?
    !! Nokogiri.jruby?
  end

  def with_default_html_version(version)
    old_version = Rails::Dom::Testing.default_html_version
    begin
      Rails::Dom::Testing.default_html_version = version
      yield
    ensure
      Rails::Dom::Testing.default_html_version = old_version
    end
  end
end