rspec-html 0.2.19 → 0.2.20

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
  SHA256:
3
- metadata.gz: 8865227f9bc455819f4ba863c81203949304871e7e99d61c28d97f7564aaad4b
4
- data.tar.gz: af0fb5b13c1ee182abf8f38a3b5ff9298db43caaf59fc5bd11c6de4e6bd6523a
3
+ metadata.gz: aaee41aa5d576b503c3e8ae1c8e99c144f5536d7975c724786ddd8331f41381f
4
+ data.tar.gz: 15d291a353ca7f423144ca71cdc987462549635e53a282a7380545a61c04e829
5
5
  SHA512:
6
- metadata.gz: 147e82f99c7412cf7cddf6439e6b6d787f0a39738a51c521dda2890545329f852797dcf242ed0ce1d61bd50c268d8dfa72fdc62ca47bfdfd041d03466d29544f
7
- data.tar.gz: 1d2758a85c78c74a39c8114f1d00dbaac9ec3a64ffec22d5fa246b1133bc789d880dc2fdcf99daddf7641546f28fa32fd6a11fd4bc01ebf89b6cc7ab5a409ca1
6
+ metadata.gz: b29060e93d1eb05b1a199832c3ac4e62ad7ad60d9357d779a25da407e0e700fd718ad6c102888117695ed942a0669391371006908cc44b818e82fdff76d23bdc
7
+ data.tar.gz: a71db0d5b3c2e34e33716e38c86579f7b180d8b0cea013a3945d1bb5e9fa1319b90d6b230c66f4c7ed0d051e7fd4acc9ff45c05ace702ae1c6a408de913e3f37
data/Gemfile CHANGED
@@ -4,3 +4,14 @@ source 'https://rubygems.org'
4
4
 
5
5
  # Specify your gem's dependencies in rspec-html.gemspec
6
6
  gemspec
7
+
8
+ gem 'activesupport', '~> 6.1'
9
+ gem 'bundler', '~> 2.0'
10
+ gem 'devpack', '~> 0.4.0'
11
+ gem 'i18n', '~> 1.7'
12
+ gem 'rake', '~> 13.0'
13
+ gem 'rspec-its', '~> 1.3'
14
+ gem 'rubocop', '~> 1.29'
15
+ gem 'rubocop-rake', '~> 0.6.0'
16
+ gem 'rubocop-rspec', '~> 2.10'
17
+ gem 'strong_versions', '~> 0.4.5'
data/Gemfile.lock CHANGED
@@ -8,6 +8,12 @@ PATH
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
+ activesupport (6.1.7.3)
12
+ concurrent-ruby (~> 1.0, >= 1.0.2)
13
+ i18n (>= 1.6, < 2)
14
+ minitest (>= 5.1)
15
+ tzinfo (~> 2.0)
16
+ zeitwerk (~> 2.3)
11
17
  ast (2.4.2)
12
18
  concurrent-ruby (1.2.2)
13
19
  devpack (0.4.1)
@@ -16,6 +22,7 @@ GEM
16
22
  concurrent-ruby (~> 1.0)
17
23
  json (2.6.3)
18
24
  mini_portile2 (2.8.2)
25
+ minitest (5.18.0)
19
26
  nokogiri (1.13.10)
20
27
  mini_portile2 (~> 2.8.0)
21
28
  racc (~> 1.4)
@@ -67,12 +74,16 @@ GEM
67
74
  strong_versions (0.4.5)
68
75
  i18n (>= 0.5)
69
76
  paint (~> 2.0)
77
+ tzinfo (2.0.6)
78
+ concurrent-ruby (~> 1.0)
70
79
  unicode-display_width (2.4.2)
80
+ zeitwerk (2.6.8)
71
81
 
72
82
  PLATFORMS
73
83
  ruby
74
84
 
75
85
  DEPENDENCIES
86
+ activesupport (~> 6.1)
76
87
  bundler (~> 2.0)
77
88
  devpack (~> 0.4.0)
78
89
  i18n (~> 1.7)
data/README.md CHANGED
@@ -109,6 +109,13 @@ To select an index from a set of matched elements use the array-style interface
109
109
  expect(document.body.div[1].span[1][:class]).to contain_text 'my-class'
110
110
  ```
111
111
 
112
+ Alternatively, use `#first`, `#last` or, when using _ActiveSupport_, `#second`, `#third`, etc. are also available:
113
+
114
+ ```ruby
115
+ expect(document.body.div.first.span.last[:class]).to contain_text 'my-class'
116
+ ```
117
+
118
+
112
119
  #### Element Existence
113
120
  To test if a matching element was found use the `exist` matcher:
114
121
  ```ruby
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RSpec
4
4
  module HTML
5
- VERSION = '0.2.19'
5
+ VERSION = '0.2.20'
6
6
  end
7
7
  end
@@ -11,7 +11,8 @@ module RSpecHTML
11
11
  :has_css?, :has_xpath?, :include?,
12
12
  :all, :siblings, :text, :truncated_text, :attributes, :to_a,
13
13
  :size, :length, :[],
14
- :css, :xpath, :checked?
14
+ :css, :xpath, :checked?,
15
+ :first, :last, :second, :third, :fourth, :fifth
15
16
 
16
17
  def initialize(element, name, options: {}, siblings: [])
17
18
  @name = name
@@ -6,6 +6,11 @@ module RSpecHTML
6
6
  class Search
7
7
  attr_reader :siblings
8
8
 
9
+ extend Forwardable
10
+
11
+ def_delegators :to_a,
12
+ :first, :last, :second, :third, :fourth, :fifth
13
+
9
14
  def initialize(element, siblings, element_wrapper)
10
15
  @element = element
11
16
  @siblings = siblings
data/rspec-html.gemspec CHANGED
@@ -31,15 +31,5 @@ Gem::Specification.new do |spec|
31
31
  spec.required_ruby_version = '>= 2.6'
32
32
  spec.add_dependency 'nokogiri', '~> 1.10'
33
33
  spec.add_dependency 'rspec', '~> 3.0'
34
-
35
- spec.add_development_dependency 'bundler', '~> 2.0'
36
- spec.add_development_dependency 'devpack', '~> 0.4.0'
37
- spec.add_development_dependency 'i18n', '~> 1.7'
38
- spec.add_development_dependency 'rake', '~> 13.0'
39
- spec.add_development_dependency 'rspec-its', '~> 1.3'
40
- spec.add_development_dependency 'rubocop', '~> 1.29'
41
- spec.add_development_dependency 'rubocop-rake', '~> 0.6.0'
42
- spec.add_development_dependency 'rubocop-rspec', '~> 2.10'
43
- spec.add_development_dependency 'strong_versions', '~> 0.4.5'
44
34
  spec.metadata['rubygems_mfa_required'] = 'true'
45
35
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-html
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.19
4
+ version: 0.2.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Farrell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-07 00:00:00.000000000 Z
11
+ date: 2023-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -38,132 +38,6 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '3.0'
41
- - !ruby/object:Gem::Dependency
42
- name: bundler
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '2.0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '2.0'
55
- - !ruby/object:Gem::Dependency
56
- name: devpack
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: 0.4.0
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: 0.4.0
69
- - !ruby/object:Gem::Dependency
70
- name: i18n
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '1.7'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '1.7'
83
- - !ruby/object:Gem::Dependency
84
- name: rake
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '13.0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '13.0'
97
- - !ruby/object:Gem::Dependency
98
- name: rspec-its
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: '1.3'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: '1.3'
111
- - !ruby/object:Gem::Dependency
112
- name: rubocop
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: '1.29'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: '1.29'
125
- - !ruby/object:Gem::Dependency
126
- name: rubocop-rake
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: 0.6.0
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "~>"
137
- - !ruby/object:Gem::Version
138
- version: 0.6.0
139
- - !ruby/object:Gem::Dependency
140
- name: rubocop-rspec
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - "~>"
144
- - !ruby/object:Gem::Version
145
- version: '2.10'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - "~>"
151
- - !ruby/object:Gem::Version
152
- version: '2.10'
153
- - !ruby/object:Gem::Dependency
154
- name: strong_versions
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - "~>"
158
- - !ruby/object:Gem::Version
159
- version: 0.4.5
160
- type: :development
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - "~>"
165
- - !ruby/object:Gem::Version
166
- version: 0.4.5
167
41
  description: HTML document abstraction and matchers for RSpec
168
42
  email:
169
43
  - git@bob.frl