rspec-html-matchers 0.9.2 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,17 @@
1
+ # encoding: utf-8
2
+ # frozen_string_literal: true
3
+
4
+ require 'spec_helper'
5
+
6
+ describe 'working on github issues' do
7
+ it '[seen Option Not Matching Seen Text (https://github.com/kucaahbe/rspec-html-matchers/issues/73)]' do
8
+ rendered = <<HTML
9
+ <p>
10
+ content with ignored
11
+ spaces
12
+ around
13
+ </p>
14
+ HTML
15
+ expect(rendered).to have_tag('p', :seen => 'content with ignored spaces around')
16
+ end
17
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  if defined?(SimpleCov)
2
4
  SimpleCov.start do
3
5
  add_group 'Main', '/lib/'
@@ -1,16 +1,16 @@
1
- module AssetHelpers
1
+ # frozen_string_literal: true
2
2
 
3
- ASSETS = File.expand_path('../../fixtures/%s.html',__FILE__)
3
+ module AssetHelpers
4
+ ASSETS = File.expand_path('../../fixtures/%s.html', __FILE__)
4
5
 
5
6
  def asset name
6
- f = fixtures[name] ||= IO.read(ASSETS%name)
7
+ f = fixtures[name] ||= IO.read(ASSETS % name)
7
8
  let(:rendered) { f }
8
9
  end
9
10
 
10
11
  private
11
12
 
12
13
  def fixtures
13
- @assets ||= {}
14
+ @fixtures ||= {}
14
15
  end
15
-
16
16
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec::Matchers.define :raise_spec_error do |expected_exception_msg|
2
4
  define_method :actual_msg do
3
5
  @actual_msg
@@ -8,11 +10,11 @@ RSpec::Matchers.define :raise_spec_error do |expected_exception_msg|
8
10
  end
9
11
 
10
12
  match do |block|
11
- begin
13
+ begin # rubocop:disable Style/RedundantBegin
12
14
  block.call
13
15
  false
14
- rescue RSpec::Expectations::ExpectationNotMetError => rspec_error
15
- @actual_msg = rspec_error.message
16
+ rescue RSpec::Expectations::ExpectationNotMetError => e
17
+ @actual_msg = e.message
16
18
 
17
19
  case expected_exception_msg
18
20
  when String
@@ -28,9 +30,9 @@ RSpec::Matchers.define :raise_spec_error do |expected_exception_msg|
28
30
 
29
31
  supports_block_expectations
30
32
 
31
- failure_message do |block|
33
+ failure_message do |_block|
32
34
  if actual_msg
33
- <<MSG
35
+ <<MSG # rubocop:disable Layout/IndentationWidth
34
36
  expected RSpec::Expectations::ExpectationNotMetError with message:
35
37
  #{expected_exception_msg}
36
38
 
@@ -38,12 +40,12 @@ got:
38
40
  #{actual_msg}
39
41
 
40
42
  Diff:
41
- #{RSpec::Support::Differ.new.diff_as_string(actual_msg,expected_exception_msg.to_s)}
43
+ #{RSpec::Support::Differ.new.diff_as_string(actual_msg, expected_exception_msg.to_s)}
42
44
  MSG
43
45
  elsif catched_exception
44
46
  "expected RSpec::Expectations::ExpectationNotMetError, but was #{catched_exception.inspect}"
45
47
  else
46
- "expected RSpec::Expectations::ExpectationNotMetError, but was no exception"
48
+ 'expected RSpec::Expectations::ExpectationNotMetError, but was no exception'
47
49
  end
48
50
  end
49
51
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-html-matchers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - kucaahbe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-10 00:00:00.000000000 Z
11
+ date: 2020-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -170,10 +170,24 @@ dependencies:
170
170
  - - ">="
171
171
  - !ruby/object:Gem::Version
172
172
  version: '0'
173
+ - !ruby/object:Gem::Dependency
174
+ name: rubocop
175
+ requirement: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - '='
178
+ - !ruby/object:Gem::Version
179
+ version: 0.76.0
180
+ type: :development
181
+ prerelease: false
182
+ version_requirements: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - '='
185
+ - !ruby/object:Gem::Version
186
+ version: 0.76.0
173
187
  description: 'Nokogiri based ''have_tag'' and ''with_tag'' matchers for rspec 3. Does
174
188
  not depend on assert_select matcher, provides useful error messages.
175
189
 
176
- '
190
+ '
177
191
  email:
178
192
  - kucaahbe@ukr.net
179
193
  - randoum@gmail.com
@@ -196,6 +210,7 @@ files:
196
210
  - spec/form_matchers_spec.rb
197
211
  - spec/have_empty_tag_spec.rb
198
212
  - spec/have_tag_spec.rb
213
+ - spec/issues_spec.rb
199
214
  - spec/spec_helper.rb
200
215
  - spec/support/asset_helpers.rb
201
216
  - spec/support/raise_spec_error_helper.rb
@@ -218,17 +233,18 @@ required_rubygems_version: !ruby/object:Gem::Requirement
218
233
  - !ruby/object:Gem::Version
219
234
  version: '0'
220
235
  requirements: []
221
- rubygems_version: 3.0.3
236
+ rubygems_version: 3.0.6
222
237
  signing_key:
223
238
  specification_version: 4
224
239
  summary: Nokogiri based 'have_tag' and 'with_tag' matchers for rspec 3
225
240
  test_files:
226
- - spec/have_tag_spec.rb
227
- - spec/support/asset_helpers.rb
228
- - spec/support/raise_spec_error_helper.rb
241
+ - spec/form_matchers_spec.rb
229
242
  - spec/spec_helper.rb
230
243
  - spec/have_empty_tag_spec.rb
231
- - spec/form_matchers_spec.rb
244
+ - spec/issues_spec.rb
245
+ - spec/support/raise_spec_error_helper.rb
246
+ - spec/support/asset_helpers.rb
247
+ - spec/have_tag_spec.rb
232
248
  - features/support/env.rb
233
249
  - features/step_definitions/steps.rb
234
250
  - features/js_generated_content.feature