rails-dom-testing 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +38 -20
- data/lib/rails/dom/testing/assertions/dom_assertions.rb +57 -11
- data/lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb +129 -117
- data/lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb +38 -24
- data/lib/rails/dom/testing/assertions/selector_assertions.rb +280 -232
- data/lib/rails/dom/testing/assertions.rb +4 -3
- data/lib/rails/dom/testing/railtie.rb +14 -0
- data/lib/rails/dom/testing/version.rb +3 -1
- data/lib/rails/dom/testing.rb +52 -0
- data/lib/rails-dom-testing.rb +4 -1
- data/test/dom_assertions_test.rb +93 -5
- data/test/parser_selection_test.rb +75 -0
- data/test/selector_assertions_test.rb +122 -71
- data/test/test_helper.rb +21 -4
- metadata +18 -29
- data/lib/rails/dom/testing/assertions/selector_assertions/count_describable.rb +0 -28
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.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafael Mendonça França
|
@@ -9,22 +9,8 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-08-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: nokogiri
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
requirements:
|
18
|
-
- - ">="
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: '1.6'
|
21
|
-
type: :runtime
|
22
|
-
prerelease: false
|
23
|
-
version_requirements: !ruby/object:Gem::Requirement
|
24
|
-
requirements:
|
25
|
-
- - ">="
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
version: '1.6'
|
28
14
|
- !ruby/object:Gem::Dependency
|
29
15
|
name: activesupport
|
30
16
|
requirement: !ruby/object:Gem::Requirement
|
@@ -40,35 +26,35 @@ dependencies:
|
|
40
26
|
- !ruby/object:Gem::Version
|
41
27
|
version: 5.0.0
|
42
28
|
- !ruby/object:Gem::Dependency
|
43
|
-
name:
|
29
|
+
name: minitest
|
44
30
|
requirement: !ruby/object:Gem::Requirement
|
45
31
|
requirements:
|
46
32
|
- - ">="
|
47
33
|
- !ruby/object:Gem::Version
|
48
|
-
version: '
|
49
|
-
type: :
|
34
|
+
version: '0'
|
35
|
+
type: :runtime
|
50
36
|
prerelease: false
|
51
37
|
version_requirements: !ruby/object:Gem::Requirement
|
52
38
|
requirements:
|
53
39
|
- - ">="
|
54
40
|
- !ruby/object:Gem::Version
|
55
|
-
version: '
|
41
|
+
version: '0'
|
56
42
|
- !ruby/object:Gem::Dependency
|
57
|
-
name:
|
43
|
+
name: nokogiri
|
58
44
|
requirement: !ruby/object:Gem::Requirement
|
59
45
|
requirements:
|
60
46
|
- - ">="
|
61
47
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
63
|
-
type: :
|
48
|
+
version: '1.6'
|
49
|
+
type: :runtime
|
64
50
|
prerelease: false
|
65
51
|
version_requirements: !ruby/object:Gem::Requirement
|
66
52
|
requirements:
|
67
53
|
- - ">="
|
68
54
|
- !ruby/object:Gem::Version
|
69
|
-
version: '
|
55
|
+
version: '1.6'
|
70
56
|
- !ruby/object:Gem::Dependency
|
71
|
-
name:
|
57
|
+
name: rake
|
72
58
|
requirement: !ruby/object:Gem::Requirement
|
73
59
|
requirements:
|
74
60
|
- - ">="
|
@@ -81,8 +67,8 @@ dependencies:
|
|
81
67
|
- - ">="
|
82
68
|
- !ruby/object:Gem::Version
|
83
69
|
version: '0'
|
84
|
-
description:
|
85
|
-
using Nokogiri.
|
70
|
+
description: This gem can compare doms and assert certain elements exists in doms
|
71
|
+
using Nokogiri.
|
86
72
|
email:
|
87
73
|
- rafaelmfranca@gmail.com
|
88
74
|
- kaspth@gmail.com
|
@@ -93,14 +79,16 @@ files:
|
|
93
79
|
- MIT-LICENSE
|
94
80
|
- README.md
|
95
81
|
- lib/rails-dom-testing.rb
|
82
|
+
- lib/rails/dom/testing.rb
|
96
83
|
- lib/rails/dom/testing/assertions.rb
|
97
84
|
- lib/rails/dom/testing/assertions/dom_assertions.rb
|
98
85
|
- lib/rails/dom/testing/assertions/selector_assertions.rb
|
99
|
-
- lib/rails/dom/testing/assertions/selector_assertions/count_describable.rb
|
100
86
|
- lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb
|
101
87
|
- lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb
|
88
|
+
- lib/rails/dom/testing/railtie.rb
|
102
89
|
- lib/rails/dom/testing/version.rb
|
103
90
|
- test/dom_assertions_test.rb
|
91
|
+
- test/parser_selection_test.rb
|
104
92
|
- test/selector_assertions_test.rb
|
105
93
|
- test/test_helper.rb
|
106
94
|
homepage: https://github.com/rails/rails-dom-testing
|
@@ -115,7 +103,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
115
103
|
requirements:
|
116
104
|
- - ">="
|
117
105
|
- !ruby/object:Gem::Version
|
118
|
-
version:
|
106
|
+
version: 2.5.0
|
119
107
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
108
|
requirements:
|
121
109
|
- - ">="
|
@@ -128,5 +116,6 @@ specification_version: 4
|
|
128
116
|
summary: Dom and Selector assertions for Rails applications
|
129
117
|
test_files:
|
130
118
|
- test/dom_assertions_test.rb
|
119
|
+
- test/parser_selection_test.rb
|
131
120
|
- test/selector_assertions_test.rb
|
132
121
|
- test/test_helper.rb
|
@@ -1,28 +0,0 @@
|
|
1
|
-
module Rails
|
2
|
-
module Dom
|
3
|
-
module Testing
|
4
|
-
module Assertions
|
5
|
-
module SelectorAssertions
|
6
|
-
module CountDescribable
|
7
|
-
private
|
8
|
-
def count_description(min, max, count) #:nodoc:
|
9
|
-
if min && max && (max != min)
|
10
|
-
"between #{min} and #{max} elements"
|
11
|
-
elsif min && max && max == min && count
|
12
|
-
"exactly #{count} #{pluralize_element(min)}"
|
13
|
-
elsif min && !(min == 1 && max == 1)
|
14
|
-
"at least #{min} #{pluralize_element(min)}"
|
15
|
-
elsif max
|
16
|
-
"at most #{max} #{pluralize_element(max)}"
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
def pluralize_element(quantity)
|
21
|
-
quantity == 1 ? 'element' : 'elements'
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|