rails-dom-testing VS Nokogiri

Compare rails-dom-testing vs Nokogiri and see what are their differences.

rails-dom-testing

Extracting DomAssertions and SelectorAssertions from ActionView. (by rails)

Nokogiri

Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby. (by sparklemotion)
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
rails-dom-testing Nokogiri
3 20
172 6,111
3.5% 0.3%
7.8 9.4
4 months ago 6 days ago
Ruby C
MIT License MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

rails-dom-testing

Posts with mentions or reviews of rails-dom-testing. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-06-05.
  • Did you know Nokogiri now has opt-in HTML5 parsing?
    7 projects | /r/ruby | 5 Jun 2023
    Switching to HTML5 parsing for everything is a very good idea, but in a lot of cases it's not straightforward because -- blurgh -- people tend to write unit tests that assert on the exact output string. Currently Discourse is dealing with this, and I've started work to upgrade Mastodon and am hitting similar problems. (Worth noting that Rails provides a test helper, assert_dom_equals, that should cover the majority of use cases.)
  • https://np.reddit.com/r/rails/comments/mfj94y/is_there_a_way_to_unit_test_a_regular_view/gsujvx5/
    1 project | /r/backtickbot | 30 Mar 2021
    class SomeViewTest < ActiveSupport::TestCase include Rails::Dom::Testing::Assertions::SelectorAssertions def test_some_view html = ActionController::Base.new.render_to_string "shared/_progress_indicator", layout: false, locals: { percent: 9 } # @selected is part of SelectorAssertions # https://github.com/rails/rails-dom-testing/blob/8f5acdfcb83a888c06592bad05475b7463998d1b/test/selector_assertions_test.rb#L332 @selected = Nokogiri::HTML.parse(html) # And then write the view tests assert_select "div" # etc. end end
  • Is there a way to unit test a regular view ?
    2 projects | /r/rails | 29 Mar 2021
    # @selected is part of SelectorAssertions # https://github.com/rails/rails-dom-testing/blob/8f5acdfcb83a888c06592bad05475b7463998d1b/test/selector_assertions_test.rb#L332 @selected = Nokogiri::HTML.parse(html) # And then write the view tests assert_select "div" # etc.

Nokogiri

Posts with mentions or reviews of Nokogiri. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-02-20.

What are some alternatives?

When comparing rails-dom-testing and Nokogiri you can also consider the following projects:

loofah - Ruby library for HTML/XML transformation and sanitization

Oga - Oga is an XML/HTML parser written in Ruby.

Ox - Ruby Optimized XML Parser

HTML::Pipeline - HTML processing filters and utilities

Oj - Optimized JSON

ROXML - ROXML is a module for binding Ruby classes to XML. It supports custom mapping and bidirectional marshalling between Ruby and XML using annotation-style class methods, via Nokogiri or LibXML.

HappyMapper - Object to XML mapping library, using Nokogiri (Fork from John Nunemaker's Happymapper)

Sablon - Ruby Document Template Processor based on docx templates and Mail Merge fields.

rubygems - Library packaging and distribution for Ruby.

Tomlrb - A Racc based TOML parser

Async Ruby - An awesome asynchronous event-driven reactor for Ruby.

nixpkgs - Nix Packages collection & NixOS