rails-dom-testing 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 61edc9fa5e40088f189be03e372c57a555e4794f
4
- data.tar.gz: 6c0cde2f592e0fb52435d686c814907ef203ed97
3
+ metadata.gz: ecf036ed0fe5b943276e875fe22bdbd0cd892393
4
+ data.tar.gz: f11502f55645a79cade3028f47d0b83ae19db6c4
5
5
  SHA512:
6
- metadata.gz: 529f62430db89db452a82c13ee2aa575c8e288a50923c6e954941805589431d4bb03a228eb6b9828afbe0ffb26f796d3007a948abaa08fc2b07b1364b5953526
7
- data.tar.gz: 574f7c7d88a42632d46efa89ac038d0f154584aef74dc314075f09e9327d33e8d7fa42304864b74fa466bc01aa8eb3fe80112d3f094d02344d79b618d376117a
6
+ metadata.gz: e4defef0a38057db0d5f8b0864cfb81aa4c25f6af1d4f392c03287689d8c3a7e9d13e00eb796d3c48d7f23e52028edf8cf1f74f995ff588838222d84a6ece940
7
+ data.tar.gz: 31a3ccadafc9a27f12024a69b16f1cac994780f64ba43c1cf6932c4824f88a24ceba1e314904c131b8c103e3094ccb2329c7c7bb0c6b13f2967e0c3ddd6f477b
data/README.md CHANGED
@@ -5,13 +5,9 @@ Doms are compared via `assert_dom_equal` and `assert_dom_not_equal`.
5
5
  Elements are asserted via `assert_select`, `assert_select_encoded`, `assert_select_email` and a subset of the dom can be selected with `css_select`.
6
6
  The gem is developed for Rails 4.2 and above, and will not work on previous versions.
7
7
 
8
- ## Deprecation warnings when upgrading to Rails 4.2:
8
+ ## Nokogiri::CSS::SyntaxError exceptions when upgrading to Rails 4.2:
9
9
 
10
- Nokogiri is slightly more strict about the format of css selectors than the previous implementation. That's why you have warnings like:
11
-
12
- ```
13
- DEPRECATION WARNING: The assertion was not run because of an invalid css selector.
14
- ```
10
+ Nokogiri is slightly stricter about the format of CSS selectors than the previous implementation.
15
11
 
16
12
  Check the 4.2 release notes [section on `assert_select`](http://edgeguides.rubyonrails.org/4_2_release_notes.html#assert-select) for help.
17
13
 
@@ -62,9 +62,6 @@ module Rails
62
62
  root = args.size == 1 ? document_root_element : args.shift
63
63
 
64
64
  nodeset(root).css(args.first)
65
- rescue Nokogiri::CSS::SyntaxError => e
66
- ActiveSupport::Deprecation.warn("The assertion was not run because of an invalid css selector.\n#{e}", caller(2))
67
- return
68
65
  end
69
66
 
70
67
  # An assertion that selects elements and makes one or more equality tests.
@@ -177,9 +174,6 @@ module Rails
177
174
 
178
175
  nest_selection(matches, &block) if block_given? && !matches.empty?
179
176
  end
180
- rescue Nokogiri::CSS::SyntaxError => e
181
- ActiveSupport::Deprecation.warn("The assertion was not run because of an invalid css selector.\n#{e}", caller(2))
182
- return
183
177
  end
184
178
 
185
179
  # Extracts the content of an element, treats it as encoded HTML and runs
@@ -1,7 +1,7 @@
1
1
  module Rails
2
2
  module Dom
3
3
  module Testing
4
- VERSION = "2.0.0"
4
+ VERSION = "2.0.1"
5
5
  end
6
6
  end
7
7
  end
@@ -220,15 +220,15 @@ class AssertSelectTest < ActiveSupport::TestCase
220
220
  # testing invalid selectors
221
221
  def test_assert_select_with_invalid_selector
222
222
  render_html '<a href="http://example.com">hello</a>'
223
- assert_deprecated do
224
- assert_nil assert_select("[href=http://example.com]")
223
+ assert_raises Nokogiri::CSS::SyntaxError do
224
+ assert_select("[href=http://example.com]")
225
225
  end
226
226
  end
227
227
 
228
228
  def test_css_select_with_invalid_selector
229
229
  render_html '<a href="http://example.com">hello</a>'
230
- assert_deprecated do
231
- assert_nil css_select("[href=http://example.com]")
230
+ assert_raises Nokogiri::CSS::SyntaxError do
231
+ css_select("[href=http://example.com]")
232
232
  end
233
233
  end
234
234
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-dom-testing
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rafael Mendonça França
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-05-08 00:00:00.000000000 Z
12
+ date: 2016-06-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri