diff -Nru ruby-rails-dom-testing-1.0.6/debian/changelog ruby-rails-dom-testing-2.0.3/debian/changelog
--- ruby-rails-dom-testing-1.0.6/debian/changelog 2017-07-20 12:08:54.000000000 +0000
+++ ruby-rails-dom-testing-2.0.3/debian/changelog 2019-01-03 16:42:08.000000000 +0000
@@ -1,3 +1,26 @@
+ruby-rails-dom-testing (2.0.3-3) unstable; urgency=medium
+
+ * Re-upload to unstable
+ * Bump Standards-Version to 4.3.0 (no changes needed)
+
+ -- Sruthi Chandran Thu, 03 Jan 2019 22:12:08 +0530
+
+ruby-rails-dom-testing (2.0.3-2) experimental; urgency=medium
+
+ * Fix activesupport dependency version
+
+ -- Sruthi Chandran Fri, 04 May 2018 14:53:22 +0530
+
+ruby-rails-dom-testing (2.0.3-1) experimental; urgency=medium
+
+ * New upstream release
+ * Remove relax-nokogiri-dependency.patch - fixed upstream
+ * Add myself to uploaders
+ * Updated Vcs-* urls to salsa.debian.org
+ * Bump Standards-version, debhelper and compat
+
+ -- Sruthi Chandran Tue, 01 May 2018 16:06:43 +0530
+
ruby-rails-dom-testing (1.0.6-2) unstable; urgency=medium
* Team upload
diff -Nru ruby-rails-dom-testing-1.0.6/debian/compat ruby-rails-dom-testing-2.0.3/debian/compat
--- ruby-rails-dom-testing-1.0.6/debian/compat 2017-07-20 12:08:54.000000000 +0000
+++ ruby-rails-dom-testing-2.0.3/debian/compat 2019-01-03 16:42:08.000000000 +0000
@@ -1 +1 @@
-9
+11
diff -Nru ruby-rails-dom-testing-1.0.6/debian/control ruby-rails-dom-testing-2.0.3/debian/control
--- ruby-rails-dom-testing-1.0.6/debian/control 2017-07-20 12:08:54.000000000 +0000
+++ ruby-rails-dom-testing-2.0.3/debian/control 2019-01-03 16:42:08.000000000 +0000
@@ -2,16 +2,15 @@
Section: ruby
Priority: optional
Maintainer: Debian Ruby Extras Maintainers
-Uploaders: Antonio Terceiro
-Build-Depends: debhelper (>= 9~),
+Uploaders: Sruthi Chandran
+Build-Depends: debhelper (>= 11~),
gem2deb,
- ruby-activesupport (<< 2:5.0),
ruby-activesupport (>= 2:4.2.0),
ruby-nokogiri (>= 1.6.0),
ruby-rails-deprecated-sanitizer (>= 1.0.1)
-Standards-Version: 4.0.0
-Vcs-Git: https://anonscm.debian.org/git/pkg-ruby-extras/ruby-rails-dom-testing.git
-Vcs-Browser: https://anonscm.debian.org/cgit/pkg-ruby-extras/ruby-rails-dom-testing.git
+Standards-Version: 4.3.0
+Vcs-Git: https://salsa.debian.org/ruby-team/ruby-rails-dom-testing.git
+Vcs-Browser: https://salsa.debian.org/ruby-team/ruby-rails-dom-testing
Homepage: https://github.com/rails/rails-dom-testing
Testsuite: autopkgtest-pkg-ruby
XS-Ruby-Versions: all
@@ -20,7 +19,6 @@
Architecture: all
XB-Ruby-Versions: ${ruby:Versions}
Depends: ruby | ruby-interpreter,
- ruby-activesupport (<< 2:5.0),
ruby-activesupport (>= 2:4.2.0),
ruby-nokogiri (>= 1.6.0),
ruby-rails-deprecated-sanitizer (>= 1.0.1),
diff -Nru ruby-rails-dom-testing-1.0.6/debian/patches/relax-nokogiri-dependency.patch ruby-rails-dom-testing-2.0.3/debian/patches/relax-nokogiri-dependency.patch
--- ruby-rails-dom-testing-1.0.6/debian/patches/relax-nokogiri-dependency.patch 2017-07-20 12:08:54.000000000 +0000
+++ ruby-rails-dom-testing-2.0.3/debian/patches/relax-nokogiri-dependency.patch 1970-01-01 00:00:00.000000000 +0000
@@ -1,21 +0,0 @@
-Relax dependency on nokogiri
-
---- a/metadata.yml
-+++ b/metadata.yml
-@@ -17,14 +17,14 @@
- requirements:
- - - "~>"
- - !ruby/object:Gem::Version
-- version: 1.6.0
-+ version: '1.6'
- type: :runtime
- prerelease: false
- version_requirements: !ruby/object:Gem::Requirement
- requirements:
- - - "~>"
- - !ruby/object:Gem::Version
-- version: 1.6.0
-+ version: '1.6'
- - !ruby/object:Gem::Dependency
- name: activesupport
- requirement: !ruby/object:Gem::Requirement
diff -Nru ruby-rails-dom-testing-1.0.6/debian/patches/series ruby-rails-dom-testing-2.0.3/debian/patches/series
--- ruby-rails-dom-testing-1.0.6/debian/patches/series 2017-07-20 12:08:54.000000000 +0000
+++ ruby-rails-dom-testing-2.0.3/debian/patches/series 2019-01-03 16:42:08.000000000 +0000
@@ -1 +0,0 @@
-relax-nokogiri-dependency.patch
diff -Nru ruby-rails-dom-testing-1.0.6/debian/watch ruby-rails-dom-testing-2.0.3/debian/watch
--- ruby-rails-dom-testing-1.0.6/debian/watch 2017-07-20 12:08:54.000000000 +0000
+++ ruby-rails-dom-testing-2.0.3/debian/watch 2019-01-03 16:42:08.000000000 +0000
@@ -1,2 +1,2 @@
version=3
-http://pkg-ruby-extras.alioth.debian.org/cgi-bin/gemwatch/rails-dom-testing .*/rails-dom-testing-(.*).tar.gz
+https://gemwatch.debian.net/rails-dom-testing .*/rails-dom-testing-(.*).tar.gz
diff -Nru ruby-rails-dom-testing-1.0.6/lib/rails/dom/testing/assertions/selector_assertions/count_describable.rb ruby-rails-dom-testing-2.0.3/lib/rails/dom/testing/assertions/selector_assertions/count_describable.rb
--- ruby-rails-dom-testing-1.0.6/lib/rails/dom/testing/assertions/selector_assertions/count_describable.rb 2015-08-13 18:03:54.000000000 +0000
+++ ruby-rails-dom-testing-2.0.3/lib/rails/dom/testing/assertions/selector_assertions/count_describable.rb 2018-05-01 10:13:00.000000000 +0000
@@ -1,22 +1,32 @@
require 'active_support/concern'
-module CountDescripable
- extend ActiveSupport::Concern
+module Rails
+ module Dom
+ module Testing
+ module Assertions
+ module SelectorAssertions
+ module CountDescribable
+ extend ActiveSupport::Concern
- private
- def count_description(min, max, count) #:nodoc:
- if min && max && (max != min)
- "between #{min} and #{max} elements"
- elsif min && max && max == min && count
- "exactly #{count} #{pluralize_element(min)}"
- elsif min && !(min == 1 && max == 1)
- "at least #{min} #{pluralize_element(min)}"
- elsif max
- "at most #{max} #{pluralize_element(max)}"
- end
- end
+ private
+ def count_description(min, max, count) #:nodoc:
+ if min && max && (max != min)
+ "between #{min} and #{max} elements"
+ elsif min && max && max == min && count
+ "exactly #{count} #{pluralize_element(min)}"
+ elsif min && !(min == 1 && max == 1)
+ "at least #{min} #{pluralize_element(min)}"
+ elsif max
+ "at most #{max} #{pluralize_element(max)}"
+ end
+ end
- def pluralize_element(quantity)
- quantity == 1 ? 'element' : 'elements'
+ def pluralize_element(quantity)
+ quantity == 1 ? 'element' : 'elements'
+ end
+ end
+ end
+ end
end
+ end
end
diff -Nru ruby-rails-dom-testing-1.0.6/lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb ruby-rails-dom-testing-2.0.3/lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb
--- ruby-rails-dom-testing-1.0.6/lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb 2015-08-13 18:03:54.000000000 +0000
+++ ruby-rails-dom-testing-2.0.3/lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb 2018-05-01 10:13:00.000000000 +0000
@@ -2,12 +2,12 @@
require_relative 'substitution_context'
class HTMLSelector #:nodoc:
- attr_reader :selector, :tests, :message
+ attr_reader :css_selector, :tests, :message
def initialize(values, previous_selection = nil, &root_fallback)
@values = values
@root = extract_root(previous_selection, root_fallback)
- @selector = extract_selector
+ extract_selectors
@tests = extract_equality_tests
@message = @values.shift
@@ -16,8 +16,14 @@
end
end
+ def selecting_no_body? #:nodoc:
+ # Nokogiri gives the document a body element. Which means we can't
+ # run an assertion expecting there to not be a body.
+ @selector == 'body' && @tests[:count] == 0
+ end
+
def select
- filter @root.css(selector, context)
+ filter @root.css(@selector, context)
end
private
@@ -67,15 +73,15 @@
end
end
- def extract_selector
+ def extract_selectors
selector = @values.shift
unless selector.is_a? String
raise ArgumentError, "Expecting a selector as the first argument"
end
- context.substitute!(selector, @values)
- selector
+ @css_selector = context.substitute!(selector, @values.dup, true)
+ @selector = context.substitute!(selector, @values)
end
def extract_equality_tests
diff -Nru ruby-rails-dom-testing-1.0.6/lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb ruby-rails-dom-testing-2.0.3/lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb
--- ruby-rails-dom-testing-1.0.6/lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb 2015-08-13 18:03:54.000000000 +0000
+++ ruby-rails-dom-testing-2.0.3/lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb 2018-05-01 10:13:00.000000000 +0000
@@ -3,10 +3,14 @@
@substitute = '?'
end
- def substitute!(selector, values)
+ def substitute!(selector, values, format_for_presentation = false)
+ selector = selector.dup
+
while !values.empty? && substitutable?(values.first) && selector.index(@substitute)
- selector.sub! @substitute, matcher_for(values.shift)
+ selector.sub! @substitute, matcher_for(values.shift, format_for_presentation)
end
+
+ selector
end
def match(matches, attribute, matcher)
@@ -14,8 +18,13 @@
end
private
- def matcher_for(value)
- value.to_s.inspect # Nokogiri doesn't like arbitrary values without quotes, hence inspect.
+ def matcher_for(value, format_for_presentation)
+ # Nokogiri doesn't like arbitrary values without quotes, hence inspect.
+ if format_for_presentation
+ value.inspect # Avoid to_s so Regexps aren't put in quotes.
+ else
+ value.to_s.inspect
+ end
end
def substitutable?(value)
diff -Nru ruby-rails-dom-testing-1.0.6/lib/rails/dom/testing/assertions/selector_assertions.rb ruby-rails-dom-testing-2.0.3/lib/rails/dom/testing/assertions/selector_assertions.rb
--- ruby-rails-dom-testing-1.0.6/lib/rails/dom/testing/assertions/selector_assertions.rb 2015-08-13 18:03:54.000000000 +0000
+++ ruby-rails-dom-testing-2.0.3/lib/rails/dom/testing/assertions/selector_assertions.rb 2018-05-01 10:13:00.000000000 +0000
@@ -62,9 +62,6 @@
root = args.size == 1 ? document_root_element : args.shift
nodeset(root).css(args.first)
- rescue Nokogiri::CSS::SyntaxError => e
- ActiveSupport::Deprecation.warn("The assertion was not run because of an invalid css selector.\n#{e}", caller(2))
- return
end
# An assertion that selects elements and makes one or more equality tests.
@@ -166,19 +163,17 @@
selector = HTMLSelector.new(args, @selected) { nodeset document_root_element }
- if selecting_no_body?(selector)
+ if selector.selecting_no_body?
assert true
return
end
selector.select.tap do |matches|
- assert_size_match!(matches.size, selector.tests, selector.selector, selector.message)
+ assert_size_match!(matches.size, selector.tests,
+ selector.css_selector, selector.message)
nest_selection(matches, &block) if block_given? && !matches.empty?
end
- rescue Nokogiri::CSS::SyntaxError => e
- ActiveSupport::Deprecation.warn("The assertion was not run because of an invalid css selector.\n#{e}", caller(2))
- return
end
# Extracts the content of an element, treats it as encoded HTML and runs
@@ -219,7 +214,9 @@
end
content = nodeset(element || @selected).map do |elem|
- elem.children.select(&:cdata?).map(&:content)
+ elem.children.select do |child|
+ child.cdata? || (child.text? && !child.blank?)
+ end.map(&:content)
end.join
selected = Nokogiri::HTML::DocumentFragment.parse(content)
@@ -262,7 +259,7 @@
end
private
- include CountDescripable
+ include CountDescribable
def document_root_element
raise NotImplementedError, 'Implementing document_root_element makes ' \
@@ -282,12 +279,6 @@
end
end
- def selecting_no_body?(html_selector)
- # Nokogiri gives the document a body element. Which means we can't
- # run an assertion expecting there to not be a body.
- html_selector.selector == 'body' && html_selector.tests[:count] == 0
- end
-
def nest_selection(selection)
# Set @selected to allow nested assert_select.
# Can be nested several levels deep.
diff -Nru ruby-rails-dom-testing-1.0.6/lib/rails/dom/testing/assertions/tag_assertions.rb ruby-rails-dom-testing-2.0.3/lib/rails/dom/testing/assertions/tag_assertions.rb
--- ruby-rails-dom-testing-1.0.6/lib/rails/dom/testing/assertions/tag_assertions.rb 2015-08-13 18:03:54.000000000 +0000
+++ ruby-rails-dom-testing-2.0.3/lib/rails/dom/testing/assertions/tag_assertions.rb 1970-01-01 00:00:00.000000000 +0000
@@ -1,155 +0,0 @@
-require 'active_support/deprecation'
-require 'rails/deprecated_sanitizer/html-scanner'
-
-module Rails
- module Dom
- module Testing
- module Assertions
- # Pair of assertions to testing elements in the HTML output of the response.
- module TagAssertions
- # Asserts that there is a tag/node/element in the body of the response
- # that meets all of the given conditions. The +conditions+ parameter must
- # be a hash of any of the following keys (all are optional):
- #
- # * :tag: the node type must match the corresponding value
- # * :attributes: a hash. The node's attributes must match the
- # corresponding values in the hash.
- # * :parent: a hash. The node's parent must match the
- # corresponding hash.
- # * :child: a hash. At least one of the node's immediate children
- # must meet the criteria described by the hash.
- # * :ancestor: a hash. At least one of the node's ancestors must
- # meet the criteria described by the hash.
- # * :descendant: a hash. At least one of the node's descendants
- # must meet the criteria described by the hash.
- # * :sibling: a hash. At least one of the node's siblings must
- # meet the criteria described by the hash.
- # * :after: a hash. The node must be after any sibling meeting
- # the criteria described by the hash, and at least one sibling must match.
- # * :before: a hash. The node must be before any sibling meeting
- # the criteria described by the hash, and at least one sibling must match.
- # * :children: a hash, for counting children of a node. Accepts
- # the keys:
- # * :count: either a number or a range which must equal (or
- # include) the number of children that match.
- # * :less_than: the number of matching children must be less
- # than this number.
- # * :greater_than: the number of matching children must be
- # greater than this number.
- # * :only: another hash consisting of the keys to use
- # to match on the children, and only matching children will be
- # counted.
- # * :content: the textual content of the node must match the
- # given value. This will not match HTML tags in the body of a
- # tag--only text.
- #
- # Conditions are matched using the following algorithm:
- #
- # * if the condition is a string, it must be a substring of the value.
- # * if the condition is a regexp, it must match the value.
- # * if the condition is a number, the value must match number.to_s.
- # * if the condition is +true+, the value must not be +nil+.
- # * if the condition is +false+ or +nil+, the value must be +nil+.
- #
- # # Assert that there is a "span" tag
- # assert_tag tag: "span"
- #
- # # Assert that there is a "span" tag with id="x"
- # assert_tag tag: "span", attributes: { id: "x" }
- #
- # # Assert that there is a "span" tag using the short-hand
- # assert_tag :span
- #
- # # Assert that there is a "span" tag with id="x" using the short-hand
- # assert_tag :span, attributes: { id: "x" }
- #
- # # Assert that there is a "span" inside of a "div"
- # assert_tag tag: "span", parent: { tag: "div" }
- #
- # # Assert that there is a "span" somewhere inside a table
- # assert_tag tag: "span", ancestor: { tag: "table" }
- #
- # # Assert that there is a "span" with at least one "em" child
- # assert_tag tag: "span", child: { tag: "em" }
- #
- # # Assert that there is a "span" containing a (possibly nested)
- # # "strong" tag.
- # assert_tag tag: "span", descendant: { tag: "strong" }
- #
- # # Assert that there is a "span" containing between 2 and 4 "em" tags
- # # as immediate children
- # assert_tag tag: "span",
- # children: { count: 2..4, only: { tag: "em" } }
- #
- # # Get funky: assert that there is a "div", with an "ul" ancestor
- # # and an "li" parent (with "class" = "enum"), and containing a
- # # "span" descendant that contains text matching /hello world/
- # assert_tag tag: "div",
- # ancestor: { tag: "ul" },
- # parent: { tag: "li",
- # attributes: { class: "enum" } },
- # descendant: { tag: "span",
- # child: /hello world/ }
- #
- # Please note: +assert_tag+ and +assert_no_tag+ only work
- # with well-formed XHTML. They recognize a few tags as implicitly self-closing
- # (like br and hr and such) but will not work correctly with tags
- # that allow optional closing tags (p, li, td). You must explicitly
- # close all of your tags to use these assertions.
- def assert_tag(*opts)
- ActiveSupport::Deprecation.warn("assert_tag is deprecated and will be removed at Rails 5. Use assert_select to get the same feature.")
-
- opts = opts.size > 1 ? opts.last.merge({ tag: opts.first.to_s }) : opts.first
- tag = _find_tag(opts)
-
- assert tag, "expected tag, but no tag found matching #{opts.inspect} in:\n#{@response.body.inspect}"
- end
-
- # Identical to +assert_tag+, but asserts that a matching tag does _not_
- # exist. (See +assert_tag+ for a full discussion of the syntax.)
- #
- # # Assert that there is not a "div" containing a "p"
- # assert_no_tag tag: "div", descendant: { tag: "p" }
- #
- # # Assert that an unordered list is empty
- # assert_no_tag tag: "ul", descendant: { tag: "li" }
- #
- # # Assert that there is not a "p" tag with between 1 to 3 "img" tags
- # # as immediate children
- # assert_no_tag tag: "p",
- # children: { count: 1..3, only: { tag: "img" } }
- def assert_no_tag(*opts)
- ActiveSupport::Deprecation.warn("assert_no_tag is deprecated and will be removed at Rails 5. Use assert_select to get the same feature.")
-
- opts = opts.size > 1 ? opts.last.merge({ tag: opts.first.to_s }) : opts.first
- tag = _find_tag(opts)
-
- assert !tag, "expected no tag, but found tag matching #{opts.inspect} in:\n#{@response.body.inspect}"
- end
-
- def find_tag(conditions)
- ActiveSupport::Deprecation.warn("find_tag is deprecated and will be removed at Rails 5 without replacement.")
-
- _find_tag(conditions)
- end
-
- def find_all_tag(conditions)
- ActiveSupport::Deprecation.warn("find_all_tag is deprecated and will be removed at Rails 5 without replacement. Use assert_select to get the same feature.")
-
- html_scanner_document.find_all(conditions)
- end
-
- private
- def _find_tag(conditions)
- html_scanner_document.find(conditions)
- end
-
- def html_scanner_document
- xml = @response.content_type =~ /xml$/
- @html_document ||= HTML::Document.new(@response.body, false, xml)
- end
- end
- end
- end
- end
-end
diff -Nru ruby-rails-dom-testing-1.0.6/lib/rails/dom/testing/assertions.rb ruby-rails-dom-testing-2.0.3/lib/rails/dom/testing/assertions.rb
--- ruby-rails-dom-testing-1.0.6/lib/rails/dom/testing/assertions.rb 2015-08-13 18:03:54.000000000 +0000
+++ ruby-rails-dom-testing-2.0.3/lib/rails/dom/testing/assertions.rb 2018-05-01 10:13:00.000000000 +0000
@@ -7,13 +7,11 @@
module Assertions
autoload :DomAssertions, 'rails/dom/testing/assertions/dom_assertions'
autoload :SelectorAssertions, 'rails/dom/testing/assertions/selector_assertions'
- autoload :TagAssertions, 'rails/dom/testing/assertions/tag_assertions'
extend ActiveSupport::Concern
include DomAssertions
include SelectorAssertions
- include TagAssertions
end
end
end
diff -Nru ruby-rails-dom-testing-1.0.6/lib/rails/dom/testing/version.rb ruby-rails-dom-testing-2.0.3/lib/rails/dom/testing/version.rb
--- ruby-rails-dom-testing-1.0.6/lib/rails/dom/testing/version.rb 2015-08-13 18:03:54.000000000 +0000
+++ ruby-rails-dom-testing-2.0.3/lib/rails/dom/testing/version.rb 2018-05-01 10:13:00.000000000 +0000
@@ -1,7 +1,7 @@
module Rails
module Dom
module Testing
- VERSION = "1.0.6"
+ VERSION = "2.0.3"
end
end
end
diff -Nru ruby-rails-dom-testing-1.0.6/LICENSE.txt ruby-rails-dom-testing-2.0.3/LICENSE.txt
--- ruby-rails-dom-testing-1.0.6/LICENSE.txt 2015-08-13 18:03:54.000000000 +0000
+++ ruby-rails-dom-testing-2.0.3/LICENSE.txt 1970-01-01 00:00:00.000000000 +0000
@@ -1,22 +0,0 @@
-Copyright (c) 2013 Kasper Timm Hansen
-
-MIT License
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff -Nru ruby-rails-dom-testing-1.0.6/metadata.yml ruby-rails-dom-testing-2.0.3/metadata.yml
--- ruby-rails-dom-testing-1.0.6/metadata.yml 2015-08-13 18:03:54.000000000 +0000
+++ ruby-rails-dom-testing-2.0.3/metadata.yml 1970-01-01 00:00:00.000000000 +0000
@@ -1,156 +0,0 @@
---- !ruby/object:Gem::Specification
-name: rails-dom-testing
-version: !ruby/object:Gem::Version
- version: 1.0.6
-platform: ruby
-authors:
-- Rafael Mendonça França
-- Kasper Timm Hansen
-autorequire:
-bindir: bin
-cert_chain: []
-date: 2015-03-17 00:00:00.000000000 Z
-dependencies:
-- !ruby/object:Gem::Dependency
- name: nokogiri
- requirement: !ruby/object:Gem::Requirement
- requirements:
- - - "~>"
- - !ruby/object:Gem::Version
- version: 1.6.0
- type: :runtime
- prerelease: false
- version_requirements: !ruby/object:Gem::Requirement
- requirements:
- - - "~>"
- - !ruby/object:Gem::Version
- version: 1.6.0
-- !ruby/object:Gem::Dependency
- name: activesupport
- requirement: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: 4.2.0.beta
- - - "<"
- - !ruby/object:Gem::Version
- version: '5.0'
- type: :runtime
- prerelease: false
- version_requirements: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: 4.2.0.beta
- - - "<"
- - !ruby/object:Gem::Version
- version: '5.0'
-- !ruby/object:Gem::Dependency
- name: rails-deprecated_sanitizer
- requirement: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: 1.0.1
- type: :runtime
- prerelease: false
- version_requirements: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: 1.0.1
-- !ruby/object:Gem::Dependency
- name: bundler
- requirement: !ruby/object:Gem::Requirement
- requirements:
- - - "~>"
- - !ruby/object:Gem::Version
- version: '1.3'
- type: :development
- prerelease: false
- version_requirements: !ruby/object:Gem::Requirement
- requirements:
- - - "~>"
- - !ruby/object:Gem::Version
- version: '1.3'
-- !ruby/object:Gem::Dependency
- name: rake
- requirement: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: '0'
- type: :development
- prerelease: false
- version_requirements: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: '0'
-- !ruby/object:Gem::Dependency
- name: minitest
- requirement: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: '0'
- type: :development
- prerelease: false
- version_requirements: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: '0'
-description: " This gem can compare doms and assert certain elements exists in doms
- using Nokogiri. "
-email:
-- rafaelmfranca@gmail.com
-- kaspth@gmail.com
-executables: []
-extensions: []
-extra_rdoc_files: []
-files:
-- LICENSE.txt
-- README.md
-- lib/rails-dom-testing.rb
-- lib/rails/dom/testing/assertions.rb
-- lib/rails/dom/testing/assertions/dom_assertions.rb
-- lib/rails/dom/testing/assertions/selector_assertions.rb
-- lib/rails/dom/testing/assertions/selector_assertions/count_describable.rb
-- lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb
-- lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb
-- lib/rails/dom/testing/assertions/tag_assertions.rb
-- lib/rails/dom/testing/version.rb
-- test/dom_assertions_test.rb
-- test/selector_assertions_test.rb
-- test/tag_assertions_test.rb
-- test/test_helper.rb
-homepage: https://github.com/rails/rails-dom-testing
-licenses:
-- MIT
-metadata: {}
-post_install_message:
-rdoc_options: []
-require_paths:
-- lib
-required_ruby_version: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: '0'
-required_rubygems_version: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: '0'
-requirements: []
-rubyforge_project:
-rubygems_version: 2.4.5
-signing_key:
-specification_version: 4
-summary: Dom and Selector assertions for Rails applications
-test_files:
-- test/dom_assertions_test.rb
-- test/selector_assertions_test.rb
-- test/tag_assertions_test.rb
-- test/test_helper.rb
diff -Nru ruby-rails-dom-testing-1.0.6/MIT-LICENSE ruby-rails-dom-testing-2.0.3/MIT-LICENSE
--- ruby-rails-dom-testing-1.0.6/MIT-LICENSE 1970-01-01 00:00:00.000000000 +0000
+++ ruby-rails-dom-testing-2.0.3/MIT-LICENSE 2018-05-01 10:13:00.000000000 +0000
@@ -0,0 +1,23 @@
+Copyright (c) 2013-2015 Kasper Timm Hansen
+
+MIT License
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff -Nru ruby-rails-dom-testing-1.0.6/rails-dom-testing.gemspec ruby-rails-dom-testing-2.0.3/rails-dom-testing.gemspec
--- ruby-rails-dom-testing-1.0.6/rails-dom-testing.gemspec 1970-01-01 00:00:00.000000000 +0000
+++ ruby-rails-dom-testing-2.0.3/rails-dom-testing.gemspec 2018-05-01 10:13:00.000000000 +0000
@@ -0,0 +1,47 @@
+#########################################################
+# This file has been automatically generated by gem2tgz #
+#########################################################
+# -*- encoding: utf-8 -*-
+# stub: rails-dom-testing 2.0.3 ruby lib
+
+Gem::Specification.new do |s|
+ s.name = "rails-dom-testing".freeze
+ s.version = "2.0.3"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
+ s.require_paths = ["lib".freeze]
+ s.authors = ["Rafael Mendon\u{e7}a Fran\u{e7}a".freeze, "Kasper Timm Hansen".freeze]
+ s.date = "2017-05-10"
+ s.description = " This gem can compare doms and assert certain elements exists in doms using Nokogiri. ".freeze
+ s.email = ["rafaelmfranca@gmail.com".freeze, "kaspth@gmail.com".freeze]
+ s.files = ["MIT-LICENSE".freeze, "README.md".freeze, "lib/rails-dom-testing.rb".freeze, "lib/rails/dom/testing/assertions.rb".freeze, "lib/rails/dom/testing/assertions/dom_assertions.rb".freeze, "lib/rails/dom/testing/assertions/selector_assertions.rb".freeze, "lib/rails/dom/testing/assertions/selector_assertions/count_describable.rb".freeze, "lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb".freeze, "lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb".freeze, "lib/rails/dom/testing/version.rb".freeze, "test/dom_assertions_test.rb".freeze, "test/selector_assertions_test.rb".freeze, "test/test_helper.rb".freeze]
+ s.homepage = "https://github.com/rails/rails-dom-testing".freeze
+ s.licenses = ["MIT".freeze]
+ s.rubygems_version = "2.5.2.1".freeze
+ s.summary = "Dom and Selector assertions for Rails applications".freeze
+ s.test_files = ["test/dom_assertions_test.rb".freeze, "test/selector_assertions_test.rb".freeze, "test/test_helper.rb".freeze]
+
+ if s.respond_to? :specification_version then
+ s.specification_version = 4
+
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
+ s.add_runtime_dependency(%q.freeze, [">= 4.2.0"])
+ s.add_development_dependency(%q.freeze, [">= 1.3"])
+ s.add_development_dependency(%q.freeze, [">= 0"])
+ s.add_runtime_dependency(%q.freeze, [">= 1.6"])
+ s.add_development_dependency(%q.freeze, [">= 0"])
+ else
+ s.add_dependency(%q.freeze, [">= 4.2.0"])
+ s.add_dependency(%q.freeze, [">= 1.3"])
+ s.add_dependency(%q.freeze, [">= 0"])
+ s.add_dependency(%q.freeze, [">= 1.6"])
+ s.add_dependency(%q.freeze, [">= 0"])
+ end
+ else
+ s.add_dependency(%q.freeze, [">= 4.2.0"])
+ s.add_dependency(%q.freeze, [">= 1.3"])
+ s.add_dependency(%q.freeze, [">= 0"])
+ s.add_dependency(%q.freeze, [">= 1.6"])
+ s.add_dependency(%q.freeze, [">= 0"])
+ end
+end
diff -Nru ruby-rails-dom-testing-1.0.6/README.md ruby-rails-dom-testing-2.0.3/README.md
--- ruby-rails-dom-testing-1.0.6/README.md 2015-08-13 18:03:54.000000000 +0000
+++ ruby-rails-dom-testing-2.0.3/README.md 2018-05-01 10:13:00.000000000 +0000
@@ -1,18 +1,13 @@
# Rails::Dom::Testing
-[![Build Status](https://travis-ci.org/rails/rails-dom-testing.svg)](https://travis-ci.org/rails/rails-dom-testing)
This gem is responsible for comparing HTML doms and asserting that DOM elements are present in Rails applications.
Doms are compared via `assert_dom_equal` and `assert_dom_not_equal`.
Elements are asserted via `assert_select`, `assert_select_encoded`, `assert_select_email` and a subset of the dom can be selected with `css_select`.
The gem is developed for Rails 4.2 and above, and will not work on previous versions.
-## Deprecation warnings when upgrading to Rails 4.2:
+## Nokogiri::CSS::SyntaxError exceptions when upgrading to Rails 4.2:
-Nokogiri is slightly more strict about the format of css selectors than the previous implementation. That's why you have warnings like:
-
-```
-DEPRECATION WARNING: The assertion was not run because of an invalid css selector.
-```
+Nokogiri is slightly stricter about the format of CSS selectors than the previous implementation.
Check the 4.2 release notes [section on `assert_select`](http://edgeguides.rubyonrails.org/4_2_release_notes.html#assert-select) for help.
@@ -56,21 +51,23 @@
assert_select_email '#you-got-mail'
```
-The documentation in [selector_assertions.rb](https://github.com/kaspth/rails-dom-testing/blob/master/lib/rails/dom/testing/assertions/selector_assertions.rb) goes into a lot more detail of how selector assertions can be used.
+The documentation in [selector_assertions.rb](https://github.com/rails/rails-dom-testing/blob/master/lib/rails/dom/testing/assertions/selector_assertions.rb) goes into a lot more detail of how selector assertions can be used.
## Read more
Under the hood the doms are parsed with Nokogiri and you'll generally be working with these two classes:
-- [`Nokogiri::XML::Node`](http://nokogiri.org/Nokogiri/XML/Node.html)
-- [`Nokogiri::XML::NodeSet`](http://nokogiri.org/Nokogiri/XML/NodeSet.html)
+- [`Nokogiri::XML::Node`](http://www.rubydoc.info/github/sparklemotion/nokogiri/Nokogiri/XML/Node)
+- [`Nokogiri::XML::NodeSet`](http://www.rubydoc.info/github/sparklemotion/nokogiri/Nokogiri/XML/NodeSet)
Read more about Nokogiri:
- [Nokogiri](http://nokogiri.org)
-## Contributing
+## Contributing to Rails::Dom::Testing
+
+Rails::Dom::Testing is work of many contributors. You're encouraged to submit pull requests, propose
+features and discuss issues.
+
+See [CONTRIBUTING](CONTRIBUTING.md).
-1. Fork it
-2. Create your feature branch (`git checkout -b my-new-feature`)
-3. Commit your changes (`git commit -am 'Add some feature'`)
-4. Push to the branch (`git push origin my-new-feature`)
-5. Create new Pull Request
+## License
+Rails::Dom::Testing is released under the [MIT License](MIT-LICENSE).
diff -Nru ruby-rails-dom-testing-1.0.6/test/selector_assertions_test.rb ruby-rails-dom-testing-2.0.3/test/selector_assertions_test.rb
--- ruby-rails-dom-testing-1.0.6/test/selector_assertions_test.rb 2015-08-13 18:03:54.000000000 +0000
+++ ruby-rails-dom-testing-2.0.3/test/selector_assertions_test.rb 2018-05-01 10:13:00.000000000 +0000
@@ -220,18 +220,28 @@
# testing invalid selectors
def test_assert_select_with_invalid_selector
render_html 'hello'
- assert_deprecated do
- assert_nil assert_select("[href=http://example.com]")
+ assert_raises Nokogiri::CSS::SyntaxError do
+ assert_select("[href=http://example.com]")
end
end
def test_css_select_with_invalid_selector
render_html 'hello'
- assert_deprecated do
- assert_nil css_select("[href=http://example.com]")
+ assert_raises Nokogiri::CSS::SyntaxError do
+ css_select("[href=http://example.com]")
end
end
+ def test_nested_assert_select_with_match_failure_shows_nice_regex
+ render_html %Q{
foo
}
+
+ error = assert_raises Minitest::Assertion do
+ assert_select "div:match('id', ?)", /wups/
+ end
+
+ assert_match %Q{div:match('id', /wups/)}, error.message
+ end
+
def test_feed_item_encoded
render_xml <<-EOF
@@ -245,9 +255,7 @@
- Test 2
-
-
-HTML
-
-class AssertTagTest < ActiveSupport::TestCase
- include Rails::Dom::Testing::Assertions::TagAssertions
-
- class FakeResponse
- attr_accessor :content_type, :body
-
- def initialize(content_type, body)
- @content_type, @body = content_type, body
- end
- end
-
- setup do
- @response = FakeResponse.new 'html', HTML_TEST_OUTPUT
- end
-
- def test_assert_tag_tag
- assert_deprecated do
- # there is a 'form' tag
- assert_tag tag: 'form'
- # there is not an 'hr' tag
- assert_no_tag tag: 'hr'
- end
- end
-
- def test_assert_tag_attributes
- assert_deprecated do
- # there is a tag with an 'id' of 'bar'
- assert_tag attributes: { id: "bar" }
- # there is no tag with a 'name' of 'baz'
- assert_no_tag attributes: { name: "baz" }
- end
- end
-
- def test_assert_tag_parent
- assert_deprecated do
- # there is a tag with a parent 'form' tag
- assert_tag parent: { tag: "form" }
- # there is no tag with a parent of 'input'
- assert_no_tag parent: { tag: "input" }
- end
- end
-
- def test_assert_tag_child
- assert_deprecated do
- # there is a tag with a child 'input' tag
- assert_tag child: { tag: "input" }
- # there is no tag with a child 'strong' tag
- assert_no_tag child: { tag: "strong" }
- end
- end
-
- def test_assert_tag_ancestor
- assert_deprecated do
- # there is a 'li' tag with an ancestor having an id of 'foo'
- assert_tag ancestor: { attributes: { id: "foo" } }, tag: "li"
- # there is no tag of any kind with an ancestor having an href matching 'foo'
- assert_no_tag ancestor: { attributes: { href: /foo/ } }
- end
- end
-
- def test_assert_tag_descendant
- assert_deprecated do
- # there is a tag with a descendant 'li' tag
- assert_tag descendant: { tag: "li" }
- # there is no tag with a descendant 'html' tag
- assert_no_tag descendant: { tag: "html" }
- end
- end
-
- def test_assert_tag_sibling
- assert_deprecated do
- # there is a tag with a sibling of class 'item'
- assert_tag sibling: { attributes: { class: "item" } }
- # there is no tag with a sibling 'ul' tag
- assert_no_tag sibling: { tag: "ul" }
- end
- end
-
- def test_assert_tag_after
- assert_deprecated do
- # there is a tag following a sibling 'div' tag
- assert_tag after: { tag: "div" }
- # there is no tag following a sibling tag with id 'bar'
- assert_no_tag after: { attributes: { id: "bar" } }
- end
- end
-
- def test_assert_tag_before
- assert_deprecated do
- # there is a tag preceding a tag with id 'bar'
- assert_tag before: { attributes: { id: "bar" } }
- # there is no tag preceding a 'form' tag
- assert_no_tag before: { tag: "form" }
- end
- end
-
- def test_assert_tag_children_count
- assert_deprecated do
- # there is a tag with 2 children
- assert_tag children: { count: 2 }
- # in particular, there is a
tag with two children (a nameless pair of
s)
- assert_tag tag: 'ul', children: { count: 2 }
- # there is no tag with 4 children
- assert_no_tag children: { count: 4 }
- end
- end
-
- def test_assert_tag_children_less_than
- assert_deprecated do
- # there is a tag with less than 5 children
- assert_tag children: { less_than: 5 }
- # there is no 'ul' tag with less than 2 children
- assert_no_tag children: { less_than: 2 }, tag: "ul"
- end
- end
-
- def test_assert_tag_children_greater_than
- assert_deprecated do
- # there is a 'body' tag with more than 1 children
- assert_tag children: { greater_than: 1 }, tag: "body"
- # there is no tag with more than 10 children
- assert_no_tag children: { greater_than: 10 }
- end
- end
-
- def test_assert_tag_children_only
- assert_deprecated do
- # there is a tag containing only one child with an id of 'foo'
- assert_tag children: { count: 1,
- only: { attributes: { id: "foo" } } }
- # there is no tag containing only one 'li' child
- assert_no_tag children: { count: 1, only: { tag: "li" } }
- end
- end
-
- def test_assert_tag_content
- assert_deprecated do
- # the output contains the string "Name"
- assert_tag content: /Name/
- # the output does not contain the string "test"
- assert_no_tag content: /test/
- end
- end
-
- def test_assert_tag_multiple
- assert_deprecated do
- # there is a 'div', id='bar', with an immediate child whose 'action'
- # attribute matches the regexp /somewhere/.
- assert_tag tag: "div", attributes: { id: "bar" },
- child: { attributes: { action: /somewhere/ } }
-
- # there is no 'div', id='foo', with a 'ul' child with more than
- # 2 "li" children.
- assert_no_tag tag: "div", attributes: { id: "foo" },
- child: { tag: "ul",
- children: { greater_than: 2, only: { tag: "li" } } }
- end
- end
-
- def test_assert_tag_children_without_content
- assert_deprecated do
- # there is a form tag with an 'input' child which is a self closing tag
- assert_tag tag: "form",
- children: { count: 1,
- only: { tag: "input" } }
-
- # the body tag has an 'a' child which in turn has an 'img' child
- assert_tag tag: "body",
- children: { count: 1,
- only: { tag: "a",
- children: { count: 1,
- only: { tag: "img" } } } }
- end
- end
-
- def test_assert_tag_attribute_matching
- assert_deprecated do
- @response.body = ''
- assert_tag tag: 'input',
- attributes: { name: /my/, type: 'text' }
- assert_no_tag tag: 'input',
- attributes: { name: 'my', type: 'text' }
- assert_no_tag tag: 'input',
- attributes: { name: /^my$/, type: 'text' }
- end
- end
-
- def test_assert_tag_content_matching
- assert_deprecated do
- @response.body = "