minitest-have_tag 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.github/dependabot.yml +24 -0
- data/.github/workflows/ruby.yml +45 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +40 -0
- data/.rubocop_todo.yml +7 -0
- data/CODE_OF_CONDUCT.md +20 -6
- data/Gemfile +74 -0
- data/Guardfile +25 -0
- data/README.md +145 -121
- data/Rakefile +10 -13
- data/lib/minitest/have_tag/version.rb +2 -3
- data/lib/minitest/have_tag.rb +146 -111
- data/minitest-have_tag.gemspec +20 -18
- metadata +34 -113
- data/.travis.yml +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 623e8d0312c42b0f58a82525ab9d7b436ecc75b28cbb4005bf270cbbd7fadec2
|
4
|
+
data.tar.gz: 45a0fd0e3d9be6586430323535372144fc564b828004665f39a1a2290c30d22f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 344472efb8b3de1dfde5eb5863002f91d29f5d03fc797aa3d0150edc21434bc5f70ba0270a25583dc4a9ca1854e3cf5adbd580d5a6755801b35781d1d3dd00e3
|
7
|
+
data.tar.gz: 3e6d0e53d2617f9893fc86bc772ceb6acd823b170cfdf1cdde1768adf31e4b1893dfe95602ea248269d37ec08e5ca404964b4d615419c3733864b326a5d01b0f
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# To get started with Dependabot version updates, you'll need to specify which
|
2
|
+
# package ecosystems to update and where the package manifests are located.
|
3
|
+
# Please see the documentation for all configuration options:
|
4
|
+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
5
|
+
|
6
|
+
version: 2
|
7
|
+
updates:
|
8
|
+
- package-ecosystem: "github-actions"
|
9
|
+
directory: "/"
|
10
|
+
schedule:
|
11
|
+
interval: "weekly"
|
12
|
+
day: "saturday"
|
13
|
+
time: "21:45"
|
14
|
+
timezone: Asia/Kuala_Lumpur
|
15
|
+
- package-ecosystem: "bundler" # See documentation for possible values
|
16
|
+
directory: "/" # Location of package manifests
|
17
|
+
groups:
|
18
|
+
patch-and-minor-dependencies:
|
19
|
+
update-types: ["patch", "minor"]
|
20
|
+
schedule:
|
21
|
+
interval: "weekly"
|
22
|
+
day: "saturday"
|
23
|
+
time: "21:45"
|
24
|
+
timezone: Asia/Kuala_Lumpur
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
|
6
|
+
# GitHub recommends pinning actions to a commit SHA.
|
7
|
+
# To get a newer version, you will need to update the SHA.
|
8
|
+
# You can also reference a tag or branch, but the action may change without warning.
|
9
|
+
|
10
|
+
name: Ruby
|
11
|
+
|
12
|
+
on:
|
13
|
+
push:
|
14
|
+
branches: ["master", "ruby-v3x"]
|
15
|
+
pull_request:
|
16
|
+
branches: ["master", "ruby-v3x"]
|
17
|
+
|
18
|
+
permissions:
|
19
|
+
contents: read
|
20
|
+
|
21
|
+
jobs:
|
22
|
+
lint_and_test:
|
23
|
+
env:
|
24
|
+
RACK_ENV: test
|
25
|
+
COVERAGE: "true"
|
26
|
+
strategy:
|
27
|
+
matrix:
|
28
|
+
os: [ubuntu-latest, macos-latest]
|
29
|
+
ruby-version: ["3.0", "3.1", "3.2", "3.3"]
|
30
|
+
# Disable JRuby for now
|
31
|
+
# ruby-version: ["3.0", "3.1", "3.2", "3.3", "jruby-9.4"]
|
32
|
+
runs-on: ${{ matrix.os }}
|
33
|
+
timeout-minutes: 3
|
34
|
+
|
35
|
+
steps:
|
36
|
+
- uses: actions/checkout@v4
|
37
|
+
- name: Set up Ruby
|
38
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
39
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
40
|
+
uses: ruby/setup-ruby@v1
|
41
|
+
with:
|
42
|
+
ruby-version: ${{ matrix.ruby-version }}
|
43
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
44
|
+
- name: Run rake (lint and test)
|
45
|
+
run: bundle exec rake
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
2
|
+
|
3
|
+
require:
|
4
|
+
- rubocop-minitest
|
5
|
+
- rubocop-performance
|
6
|
+
- rubocop-rake
|
7
|
+
|
8
|
+
# The behavior of RuboCop can be controlled via the .rubocop.yml
|
9
|
+
# configuration file. It makes it possible to enable/disable
|
10
|
+
# certain cops (checks) and to alter their behavior if they accept
|
11
|
+
# any parameters. The file can be placed either in your home
|
12
|
+
# directory or in some project directory.
|
13
|
+
#
|
14
|
+
# RuboCop will start looking for the configuration file in the directory
|
15
|
+
# where the inspected file is and continue its way up to the root directory.
|
16
|
+
#
|
17
|
+
# See https://docs.rubocop.org/rubocop/configuration
|
18
|
+
|
19
|
+
AllCops:
|
20
|
+
TargetRubyVersion: "3.0"
|
21
|
+
NewCops: enable
|
22
|
+
|
23
|
+
Layout/LineLength:
|
24
|
+
Exclude:
|
25
|
+
- "minitest-have_tag.gemspec"
|
26
|
+
|
27
|
+
Metrics/BlockLength:
|
28
|
+
Enabled: true
|
29
|
+
Exclude:
|
30
|
+
- "spec/**/*.rb"
|
31
|
+
- "**/*.gemspec"
|
32
|
+
|
33
|
+
Style/ClassAndModuleChildren:
|
34
|
+
Exclude:
|
35
|
+
- "lib/minitest/have_tag.rb"
|
36
|
+
|
37
|
+
Style/Documentation:
|
38
|
+
Exclude:
|
39
|
+
- "spec/**/*"
|
40
|
+
- "test/**/*"
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2024-09-25 13:15:56 UTC using RuboCop version 1.66.1.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
data/CODE_OF_CONDUCT.md
CHANGED
@@ -1,13 +1,27 @@
|
|
1
1
|
# Contributor Code of Conduct
|
2
2
|
|
3
|
-
As contributors and maintainers of this project, we pledge to respect all
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all
|
4
|
+
people who contribute through reporting issues, posting feature requests,
|
5
|
+
updating documentation, submitting pull requests or patches, and other activities.
|
4
6
|
|
5
|
-
We are committed to making participation in this project a harassment-free
|
7
|
+
We are committed to making participation in this project a harassment-free
|
8
|
+
experience for everyone, regardless of level of experience, gender, gender
|
9
|
+
identity and expression, sexual orientation, disability, personal appearance,
|
10
|
+
body size, race, ethnicity, age, or religion.
|
6
11
|
|
7
|
-
Examples of unacceptable behavior by participants include the use of sexual
|
12
|
+
Examples of unacceptable behavior by participants include the use of sexual
|
13
|
+
language or imagery, derogatory comments or personal attacks, trolling, public
|
14
|
+
or private harassment, insults, or other unprofessional conduct.
|
8
15
|
|
9
|
-
Project maintainers have the right and responsibility to remove, edit, or
|
16
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
17
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
18
|
+
that are not aligned to this Code of Conduct. Project maintainers who do not
|
19
|
+
follow the Code of Conduct may be removed from the project team.
|
10
20
|
|
11
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
21
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
22
|
+
reported by opening an issue or contacting one or more of the project
|
23
|
+
maintainers.
|
12
24
|
|
13
|
-
This Code of Conduct is adapted from the
|
25
|
+
This Code of Conduct is adapted from the
|
26
|
+
[Contributor Covenant](http://contributor-covenant.org), version 1.0.0,
|
27
|
+
available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
CHANGED
@@ -1,4 +1,78 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
source 'https://rubygems.org'
|
2
4
|
|
3
5
|
# Specify your gem's dependencies in minitest-have_tag.gemspec
|
4
6
|
gemspec
|
7
|
+
|
8
|
+
# adding these to silence warnings for Ruby v3.5
|
9
|
+
gem 'fiddle'
|
10
|
+
gem 'logger'
|
11
|
+
gem 'ostruct'
|
12
|
+
|
13
|
+
group :development do
|
14
|
+
# A command line tool to easily handle events on file system modifications
|
15
|
+
# DOCS: https://github.com/guard/guard
|
16
|
+
gem 'guard'
|
17
|
+
# automatically runs your tests with Minitest framework
|
18
|
+
# DOCS: https://github.com/guard/guard-minitest
|
19
|
+
gem 'guard-minitest'
|
20
|
+
|
21
|
+
# Ruby testing framework
|
22
|
+
# DOCS: https://github.com/seattlerb/minitest
|
23
|
+
gem 'minitest', '~> 5.7', '>= 5.7.0'
|
24
|
+
# Adds specific assertions for testing exceptions with minitest
|
25
|
+
# DOCS: https://github.com/kematzy/minitest-assert_errors
|
26
|
+
gem 'minitest-assert_errors'
|
27
|
+
# Around and before_all/after_all hooks for Minitest
|
28
|
+
# DOCS: https://github.com/jeremyevans/minitest-hooks
|
29
|
+
gem 'minitest-hooks', '~> 1.1', '>= 1.1.0'
|
30
|
+
# Colored red/green output for Minitest
|
31
|
+
# DOCS: https://github.com/blowmage/minitest-rg
|
32
|
+
gem 'minitest-rg', '~> 5.3', '>= 5.3.0'
|
33
|
+
|
34
|
+
# Simple testing API for Rack apps
|
35
|
+
# DOCS: https://github.com/rack/rack-test
|
36
|
+
gem 'rack-test', '~> 2.1'
|
37
|
+
# Ruby build program with capabilities similar to Make
|
38
|
+
# DOCS: https://github.com/ruby/rake
|
39
|
+
gem 'rake', '~> 13.0'
|
40
|
+
|
41
|
+
# Ruby static code analyzer and formatter
|
42
|
+
# DOCS: https://github.com/rubocop/rubocop
|
43
|
+
gem 'rubocop', '~> 1.31', require: false
|
44
|
+
# Code style checking for Minitest files
|
45
|
+
# DOCS: https://github.com/rubocop/rubocop-minitest
|
46
|
+
gem 'rubocop-minitest', require: false
|
47
|
+
# Performance optimization analysis for your projects
|
48
|
+
# DOCS: https://github.com/rubocop/rubocop-performance
|
49
|
+
gem 'rubocop-performance', require: false
|
50
|
+
# A RuboCop extension focused on enforcing Rake best practices and coding conventions
|
51
|
+
# DOCS: https://github.com/rubocop/rubocop-rake
|
52
|
+
gem 'rubocop-rake', require: false
|
53
|
+
|
54
|
+
# Code coverage for Ruby
|
55
|
+
# DOCS: https://github.com/simplecov-ruby/simplecov
|
56
|
+
gem 'simplecov'
|
57
|
+
end
|
58
|
+
|
59
|
+
# Linux-specific gems
|
60
|
+
install_if -> { RUBY_PLATFORM.include?('linux') } do
|
61
|
+
# Linux inotify wrapper for Ruby
|
62
|
+
# DOCS: https://github.com/guard/rb-inotify
|
63
|
+
gem 'rb-inotify', require: false
|
64
|
+
end
|
65
|
+
|
66
|
+
# macOS-specific gems
|
67
|
+
install_if -> { RUBY_PLATFORM.include?('darwin') } do
|
68
|
+
# FSEvents API with signals handled for macOS
|
69
|
+
# DOCS: https://github.com/thibaudgg/rb-fsevent
|
70
|
+
gem 'rb-fsevent', require: false
|
71
|
+
end
|
72
|
+
|
73
|
+
# Windows-specific gems
|
74
|
+
install_if -> { Gem.win_platform? } do
|
75
|
+
# Windows Directory Monitor - A library which can be used to monitor directories for changes
|
76
|
+
# DOCS: https://github.com/Maher4Ever/wdm
|
77
|
+
gem 'wdm'
|
78
|
+
end
|
data/Guardfile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# A sample Guardfile
|
4
|
+
# More info at https://github.com/guard/guard#readme
|
5
|
+
|
6
|
+
## Uncomment and set this to only include directories you want to watch
|
7
|
+
# directories %w(app lib config test spec features) \
|
8
|
+
# .select{|d| Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist")}
|
9
|
+
|
10
|
+
## Note: if you are using the `directories` clause above and you are not
|
11
|
+
## watching the project directory ('.'), then you will want to move
|
12
|
+
## the Guardfile to a watched dir and symlink it back, e.g.
|
13
|
+
#
|
14
|
+
# $ mkdir config
|
15
|
+
# $ mv Guardfile config/
|
16
|
+
# $ ln -s config/Guardfile .
|
17
|
+
#
|
18
|
+
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
|
19
|
+
|
20
|
+
guard :minitest do
|
21
|
+
# with Minitest::Spec
|
22
|
+
watch(%r{^spec/(.*)_spec\.rb$})
|
23
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
24
|
+
watch(%r{^spec/spec_helper\.rb$}) { 'spec' }
|
25
|
+
end
|
data/README.md
CHANGED
@@ -1,209 +1,233 @@
|
|
1
1
|
# Minitest::HaveTag
|
2
2
|
|
3
|
-
|
4
|
-
string.
|
3
|
+
[](https://github.com/kematzy/minitest-have_tag/actions/workflows/ruby.yml) - [](https://badge.fury.io/rb/minitest-have_tag) - [](https://github.com/rubocop/rubocop-minitest)
|
5
4
|
|
6
|
-
|
5
|
+
Adds methods to Minitest to test for existence of HTML tags, including contents,
|
6
|
+
within a provided string.
|
7
|
+
|
8
|
+
## Added methods:
|
7
9
|
|
8
10
|
### Minitest::Assertions
|
9
11
|
|
10
|
-
|
12
|
+
- **`:assert_have_tag(actual, expected, contents = nil, msg = nil)`**
|
11
13
|
|
12
|
-
|
14
|
+
- **`:refute_have_tag(actual, expected, contents = nil, msg = nil)`**
|
13
15
|
|
14
16
|
### Minitest::Expectations
|
15
17
|
|
16
|
-
|
18
|
+
- **_(actual).`must_have_tag(expected, contents = nil, msg = nil)`**
|
17
19
|
|
18
|
-
|
20
|
+
- **_(actual).`wont_have_tag(expected, contents = nil, msg = nil)`**
|
19
21
|
|
20
|
-
<br>
|
21
22
|
---
|
22
23
|
|
23
24
|
## Installation
|
24
25
|
|
25
|
-
Add this
|
26
|
+
Add this gem to your application `Gemfile`:
|
26
27
|
|
27
28
|
```ruby
|
28
29
|
gem 'minitest-have_tag'
|
29
30
|
```
|
30
31
|
|
31
|
-
|
32
|
+
or for the cutting edge:
|
32
33
|
|
33
|
-
|
34
|
+
```ruby
|
35
|
+
gem 'minitest-have_tag',
|
36
|
+
git: 'https://github.com/kematzy/minitest-have_tag',
|
37
|
+
branch: 'master'
|
38
|
+
```
|
34
39
|
|
35
|
-
|
40
|
+
To install the gems, run:
|
36
41
|
|
37
|
-
|
42
|
+
```bash
|
43
|
+
bundle install
|
44
|
+
```
|
38
45
|
|
39
|
-
<br>
|
40
46
|
---
|
41
47
|
|
42
|
-
|
43
48
|
## Usage
|
44
49
|
|
45
|
-
|
46
|
-
file as follows:
|
50
|
+
Load the gem in your `spec/spec_helper.rb` file as follows:
|
47
51
|
|
48
52
|
```ruby
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
# <snip...>
|
53
|
+
# <snip...>
|
54
|
+
|
55
|
+
require 'minitest/autorun'
|
56
|
+
# load assert_have_tag() support
|
57
|
+
require 'minitest/have_tag'
|
58
|
+
|
59
|
+
# <snip...>
|
57
60
|
```
|
58
61
|
|
59
|
-
Adding the above to your `spec_helper.rb` file automatically adds the key
|
60
|
-
`Minitest::Assertions` to test for existence of HTML tag,
|
61
|
-
String.
|
62
|
+
Adding the above to your `spec/spec_helper.rb` file automatically adds the key
|
63
|
+
helper methods to the `Minitest::Assertions` to test for existence of HTML tag,
|
64
|
+
including contents, within the provided String.
|
62
65
|
|
63
|
-
|
66
|
+
---
|
64
67
|
|
65
68
|
### `assert_have_tag()`
|
66
69
|
|
67
70
|
```ruby
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
```
|
71
|
+
assert_have_tag('<br>', 'br')
|
72
|
+
|
73
|
+
# check for CSS :class attribute
|
74
|
+
assert_have_tag('<hr class="divider">', 'hr.divider')
|
75
|
+
assert_have_tag('<hr class="divider">', 'hr[@class=divider]')
|
76
|
+
|
77
|
+
# check for CSS :id attribute
|
78
|
+
assert_have_tag('<hr id="divider">', 'hr#divider')
|
79
|
+
assert_have_tag('<hr id="divider">', 'hr[@id=divider]')
|
80
|
+
|
81
|
+
# check for contents within a <div...>
|
82
|
+
assert_have_tag('<div class="row">contents</div>', 'hr.row', 'contents')
|
83
|
+
|
84
|
+
html = <<~HTML
|
85
|
+
<div id="intro" class="row">
|
86
|
+
<div class="col-md-12">
|
87
|
+
<h1>Header</h1>
|
88
|
+
</div>
|
89
|
+
</div>
|
90
|
+
HTML
|
91
|
+
|
92
|
+
#
|
93
|
+
assert_have_tag(html, 'div#intro.row > .col-md-12 > h1', 'Header')
|
94
|
+
```
|
93
95
|
|
94
96
|
Produces an extensive error message when something is wrong
|
95
97
|
|
96
|
-
```ruby
|
97
|
-
|
98
|
+
```ruby
|
99
|
+
assert_have_tag('<br>', 'brr')
|
98
100
|
#=> 'Expected "<br>" to have tag ["brr"], but no such tag was found'
|
99
101
|
```
|
100
102
|
|
101
|
-
|
103
|
+
---
|
102
104
|
|
103
105
|
### `:refute_have_tag()`
|
104
|
-
|
105
|
-
Method to test for non-existence of the expected HTML tag, including contents,
|
106
|
+
|
107
|
+
Method to test for non-existence of the expected HTML tag, including contents,
|
106
108
|
within the provided string.
|
107
109
|
|
108
110
|
```ruby
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
111
|
+
refute_have_tag('<abbr>', 'br')
|
112
|
+
|
113
|
+
# check for CSS :class attribute
|
114
|
+
refute_have_tag('<hr class="divider">', 'hr.space')
|
115
|
+
refute_have_tag('<hr class="divider">', 'hr[@class=space]')
|
116
|
+
|
117
|
+
# check for CSS :id attribute
|
118
|
+
refute_have_tag('<hr id="divider">', 'hr#space')
|
119
|
+
refute_have_tag('<hr id="divider">', 'hr[@id=space]')
|
120
|
+
|
121
|
+
# check for contents within a <div...>
|
122
|
+
refute_have_tag('<div class="row">contents</div>', 'hr.row', '<h1>Header</h1>')
|
123
|
+
|
124
|
+
html = <<~HTML
|
125
|
+
<div id="intro" class="row">
|
126
|
+
<div class="col-md-12">
|
127
|
+
<h1>Header</h1>
|
128
|
+
</div>
|
129
|
+
</div>
|
130
|
+
HTML
|
131
|
+
|
132
|
+
#
|
133
|
+
refute_have_tag(html, 'div#intro.row > .col-md-12 > h1', 'Header')
|
131
134
|
```
|
132
|
-
|
135
|
+
|
133
136
|
Produces an extensive error message when something is wrong:
|
134
|
-
|
137
|
+
|
135
138
|
```ruby
|
136
139
|
refute_have_tag('<br>', 'br')
|
137
140
|
#=> 'Expected "<br>" to NOT have tag ["br"], but such a tag was found'
|
138
141
|
```
|
139
142
|
|
140
|
-
|
141
|
-
<br>
|
142
|
-
---
|
143
|
+
---
|
143
144
|
|
144
145
|
## Dependencies
|
145
146
|
|
146
147
|
This Gem depends upon the following:
|
147
148
|
|
148
|
-
### Runtime
|
149
|
+
### Runtime
|
149
150
|
|
150
|
-
|
151
|
-
|
151
|
+
- minitest
|
152
|
+
- nokogiri
|
152
153
|
|
154
|
+
### Development & Tests
|
153
155
|
|
154
|
-
|
156
|
+
- guard
|
157
|
+
- guard-minitest
|
158
|
+
- minitest
|
159
|
+
- minitest-assert_errors
|
160
|
+
- minitest-hooks
|
161
|
+
- minitest-rg
|
162
|
+
- rack-test (~> 2.1)
|
163
|
+
- rake (~> 13.0)
|
164
|
+
- rubocop (~> 1.31)
|
165
|
+
- rubocop-minitest
|
166
|
+
- rubocop-performance
|
167
|
+
- rubocop-rake
|
168
|
+
- simplecov
|
155
169
|
|
156
|
-
|
157
|
-
* rake (~> 10.0)
|
158
|
-
* minitest-hooks
|
159
|
-
* minitest-rg
|
170
|
+
---
|
160
171
|
|
161
|
-
|
172
|
+
## Development
|
162
173
|
|
174
|
+
Get started with these commands:
|
163
175
|
|
164
|
-
|
176
|
+
```bash
|
177
|
+
# clone the repository
|
178
|
+
git clone https://github.com/kematzy/minitest-have_tag.git
|
165
179
|
|
180
|
+
# change into repository directory
|
181
|
+
cd minitest-have_tag/
|
166
182
|
|
167
|
-
|
183
|
+
# install dependencies
|
184
|
+
bundle install
|
168
185
|
|
169
|
-
|
170
|
-
|
186
|
+
# run the default tests with coverage & rubocop checking
|
187
|
+
bundle exec rake
|
171
188
|
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
[rubygems.org](https://rubygems.org).
|
189
|
+
# enable automatic reloading of tests during development
|
190
|
+
bundle exec guard
|
191
|
+
```
|
176
192
|
|
177
|
-
|
193
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
178
194
|
|
195
|
+
To release a new version:
|
179
196
|
|
180
|
-
|
197
|
+
- ensure `bundle exec rake` passes.
|
198
|
+
- update the version number in `version.rb`.
|
199
|
+
- run `bundle exec rake release` to:
|
200
|
+
- create a Git tag for the version;
|
201
|
+
- pushes Git commits and tags to GitHub;
|
202
|
+
- pushes the `.gem` file to [rubygems.org](https://rubygems.org).
|
181
203
|
|
182
|
-
|
204
|
+
---
|
183
205
|
|
184
|
-
|
185
|
-
expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
206
|
+
## Contributing
|
186
207
|
|
187
|
-
|
208
|
+
Bug reports and pull requests are welcome on [GitHub](https://github.com/kematzy/minitest-have_tag).
|
188
209
|
|
210
|
+
This project is intended to be a safe, welcoming space for collaboration, and
|
211
|
+
contributors are expected to adhere to the
|
212
|
+
[Contributor Covenant](contributor-covenant.org) code of conduct.
|
189
213
|
|
190
|
-
|
191
|
-
|
192
|
-
* Fork the project.
|
193
|
-
* Make your feature addition or bug fix in a separate branch.
|
194
|
-
* Add spec tests for it. This is important so I don't break it in a future version unintentionally.
|
195
|
-
* Commit, do not mess with Rakefile, version, or history.
|
196
|
-
* (if you want to have your own version, that is fine but bump version in a commit by itself
|
197
|
-
I can ignore when I pull)
|
198
|
-
* Send me a pull request. Bonus points for topic branches.
|
214
|
+
---
|
199
215
|
|
216
|
+
## Note on Patches/Pull Requests
|
200
217
|
|
201
|
-
|
218
|
+
- Fork the project.
|
219
|
+
- Make your feature addition or bug fix in a separate branch.
|
220
|
+
- Add spec tests for it. This is important so I don't break it in a future
|
221
|
+
version unintentionally.
|
222
|
+
- Commit, do not mess with Rakefile, version, or history.
|
223
|
+
- (if you want to have your own version, that is fine but bump version in
|
224
|
+
a commit by itself I can ignore when I pull)
|
225
|
+
- Send me a pull request. Bonus points for topic branches.
|
202
226
|
|
227
|
+
---
|
203
228
|
|
204
229
|
## Copyright
|
205
230
|
|
206
|
-
Copyright (c) 2015 Kematzy
|
231
|
+
Copyright (c) 2015 - 2024 Kematzy
|
207
232
|
|
208
233
|
Released under the MIT License. See LICENSE for further details.
|
209
|
-
|
data/Rakefile
CHANGED
@@ -1,28 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'bundler/gem_tasks'
|
4
|
+
require 'rubocop/rake_task'
|
2
5
|
require 'rake/testtask'
|
3
6
|
|
7
|
+
RuboCop::RakeTask.new
|
8
|
+
|
4
9
|
Rake::TestTask.new(:spec) do |t|
|
5
10
|
t.libs << 'spec'
|
6
11
|
t.libs << 'lib'
|
12
|
+
t.options = '--rg'
|
7
13
|
t.test_files = FileList['spec/**/*_spec.rb']
|
8
14
|
end
|
9
15
|
|
10
|
-
task :
|
16
|
+
task default: %i[rubocop coverage]
|
17
|
+
|
18
|
+
desc 'alias for spec task'
|
19
|
+
task test: :spec
|
11
20
|
|
12
21
|
desc 'Run specs with coverage'
|
13
22
|
task :coverage do
|
14
23
|
ENV['COVERAGE'] = '1'
|
15
24
|
Rake::Task['spec'].invoke
|
16
|
-
# `open coverage/index.html` # if OSX
|
17
|
-
end
|
18
|
-
|
19
|
-
desc 'Run Rubocop report'
|
20
|
-
task :rubocop do
|
21
|
-
res = `which rubocop`
|
22
|
-
if res != ""
|
23
|
-
`rubocop -f html -o ./rubocop/report.html lib/`
|
24
|
-
# `open rubocop/report.html` # if OSX
|
25
|
-
else
|
26
|
-
puts "\nERROR: 'rubocop' gem is not installed or available. Please install with 'gem install rubocop'."
|
27
|
-
end
|
28
25
|
end
|
data/lib/minitest/have_tag.rb
CHANGED
@@ -1,24 +1,39 @@
|
|
1
|
+
# frozen_string_literal: false
|
2
|
+
|
1
3
|
require 'minitest'
|
2
4
|
require 'minitest/have_tag/version'
|
3
5
|
|
6
|
+
# rubocop:disable Style/Documentation
|
4
7
|
module Minitest::Assertions
|
5
8
|
require 'nokogiri'
|
6
|
-
|
9
|
+
|
7
10
|
# Method to test for existence of HTML tag, including contents, within the provided string.
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
11
|
+
#
|
12
|
+
# This method asserts that a specific HTML tag or structure is present in the given HTML content.
|
13
|
+
# It can check for tags, attributes, and even specific content.
|
14
|
+
#
|
15
|
+
# @param actual [String] The HTML content to be tested
|
16
|
+
# @param expected [String] The CSS selector or tag to search for
|
17
|
+
# @param contents [String, Regexp, nil] Optional. The expected contents of the tag
|
18
|
+
# @param msg [String, nil] Optional. Custom error message
|
19
|
+
#
|
20
|
+
# @return [Boolean] True if the tag is found and matches the criteria
|
21
|
+
#
|
22
|
+
# @example Basic usage
|
23
|
+
# assert_have_tag('<br>', 'br')
|
24
|
+
#
|
25
|
+
# @example Checking for CSS class
|
12
26
|
# assert_have_tag('<hr class="divider">', 'hr.divider')
|
13
27
|
# assert_have_tag('<hr class="divider">', 'hr[@class=divider]')
|
14
|
-
#
|
15
|
-
#
|
28
|
+
#
|
29
|
+
# @example Checking for CSS id
|
16
30
|
# assert_have_tag('<hr id="divider">', 'hr#divider')
|
17
31
|
# assert_have_tag('<hr id="divider">', 'hr[@id=divider]')
|
18
|
-
#
|
19
|
-
#
|
20
|
-
# assert_have_tag('<div class="row">contents</div>', '
|
21
|
-
#
|
32
|
+
#
|
33
|
+
# @example Checking for specific content
|
34
|
+
# assert_have_tag('<div class="row">contents</div>', 'div.row', 'contents')
|
35
|
+
#
|
36
|
+
# @example Complex HTML structure
|
22
37
|
# html = <<-HTML
|
23
38
|
# <div id="intro" class="row">
|
24
39
|
# <div class="col-md-12">
|
@@ -26,73 +41,54 @@ module Minitest::Assertions
|
|
26
41
|
# </div>
|
27
42
|
# </div>
|
28
43
|
# HTML
|
29
|
-
# #
|
30
44
|
# assert_have_tag(html, 'div#intro.row > .col-md-12 > h1', 'Header')
|
31
|
-
#
|
32
|
-
#
|
33
|
-
# Produces an extensive error message when something is wrong
|
34
|
-
#
|
45
|
+
#
|
46
|
+
# @example Error message
|
35
47
|
# assert_have_tag('<br>', 'brr')
|
36
|
-
#
|
37
|
-
#
|
48
|
+
# # Raises error: 'Expected "<br>" to have tag ["brr"], but no such tag was found'
|
38
49
|
#
|
39
50
|
def assert_have_tag(actual, expected, contents = nil, msg = nil)
|
40
|
-
msg = msg
|
41
|
-
msg << "Expected #{actual.inspect} to have tag [#{expected.inspect}]"
|
42
|
-
|
51
|
+
msg = build_message(msg, actual, expected)
|
43
52
|
doc = Nokogiri::HTML(actual)
|
44
|
-
res
|
45
|
-
|
53
|
+
res = doc.css(expected)
|
54
|
+
|
46
55
|
if res.empty?
|
47
56
|
msg << ', but no such tag was found'
|
48
57
|
matching = false
|
49
58
|
else
|
50
|
-
|
51
|
-
matching = true
|
52
|
-
|
53
|
-
if contents
|
54
|
-
if contents.is_a?(String)
|
55
|
-
if res.inner_html == contents
|
56
|
-
matching = true
|
57
|
-
else
|
58
|
-
msg << " with contents [#{contents.inspect}], but the tag content is [#{res.inner_html}]"
|
59
|
-
matching = false
|
60
|
-
end
|
61
|
-
elsif contents.is_a?(Regexp)
|
62
|
-
if res.inner_html =~ contents
|
63
|
-
matching = true
|
64
|
-
else
|
65
|
-
msg << " with inner_html [#{res.inner_html}],"
|
66
|
-
msg << " but did not match Regexp [#{contents.inspect}]"
|
67
|
-
matching = false
|
68
|
-
end
|
69
|
-
else
|
70
|
-
msg << ", ERROR: contents is neither String nor Regexp, it's [#{contents.class}]"
|
71
|
-
matching = false
|
72
|
-
end
|
73
|
-
else
|
74
|
-
# no contents given, so ignore
|
75
|
-
end
|
59
|
+
matching = check_contents(res, contents, msg)
|
76
60
|
end
|
77
61
|
assert matching, msg
|
78
62
|
end
|
79
|
-
|
80
|
-
# Method to test for non-existence of the expected HTML tag, including contents,
|
63
|
+
|
64
|
+
# Method to test for non-existence of the expected HTML tag, including contents,
|
81
65
|
# within the provided string.
|
82
|
-
#
|
83
|
-
#
|
84
|
-
#
|
85
|
-
#
|
86
|
-
#
|
87
|
-
#
|
88
|
-
#
|
89
|
-
#
|
90
|
-
#
|
91
|
-
#
|
92
|
-
#
|
93
|
-
#
|
94
|
-
# refute_have_tag('<
|
95
|
-
#
|
66
|
+
#
|
67
|
+
# This method is used to assert that a specific HTML tag or structure is NOT present
|
68
|
+
# in the given HTML content. It can check for tags, attributes, and even specific content.
|
69
|
+
#
|
70
|
+
# @param actual [String] The HTML content to be tested
|
71
|
+
# @param expected [String] The CSS selector or tag to search for
|
72
|
+
# @param contents [String, Regexp, nil] Optional. The expected contents of the tag
|
73
|
+
# @param msg [String, nil] Optional. Custom error message
|
74
|
+
#
|
75
|
+
# @return [Boolean] True if the tag is not found or doesn't match the criteria
|
76
|
+
#
|
77
|
+
# @example Basic usage
|
78
|
+
# refute_have_tag('<abbr>', 'br') # Passes
|
79
|
+
#
|
80
|
+
# @example Checking for CSS class
|
81
|
+
# refute_have_tag('<hr class="divider">', 'hr.space') # Passes
|
82
|
+
# refute_have_tag('<hr class="divider">', 'hr[@class=space]') # Passes
|
83
|
+
#
|
84
|
+
# @example Checking for CSS id
|
85
|
+
# refute_have_tag('<hr id="divider">', 'hr#space') # Passes
|
86
|
+
# refute_have_tag('<hr id="divider">', 'hr[@id=space]') # Passes
|
87
|
+
#
|
88
|
+
# @example Checking for specific content
|
89
|
+
# refute_have_tag('<div class="row">contents</div>', 'hr.row', '<h1>Header</h1>') # Passes
|
90
|
+
#
|
91
|
+
# @example Complex HTML structure
|
96
92
|
# html = <<-HTML
|
97
93
|
# <div id="intro" class="row">
|
98
94
|
# <div class="col-md-12">
|
@@ -100,61 +96,100 @@ module Minitest::Assertions
|
|
100
96
|
# </div>
|
101
97
|
# </div>
|
102
98
|
# HTML
|
103
|
-
# #
|
104
|
-
#
|
105
|
-
#
|
106
|
-
#
|
107
|
-
# Produces an extensive error message when something is wrong
|
108
|
-
#
|
99
|
+
# refute_have_tag(html, 'div#intro.row > .col-md-12 > h2', 'Header') # Passes
|
100
|
+
#
|
101
|
+
# @example Error message
|
109
102
|
# refute_have_tag('<br>', 'br')
|
110
|
-
#
|
111
|
-
#
|
103
|
+
# # Raises error: 'Expected "<br>" to NOT have tag ["br"], but such a tag was found'
|
112
104
|
#
|
113
105
|
def refute_have_tag(actual, expected, contents = nil, msg = nil)
|
114
|
-
msg = msg
|
115
|
-
msg << "Expected #{actual.inspect} to NOT have tag [#{expected.inspect}]"
|
116
|
-
|
106
|
+
msg = build_message(msg, actual, expected, refute: true)
|
117
107
|
doc = Nokogiri::HTML(actual)
|
118
|
-
res
|
119
|
-
|
120
|
-
|
121
|
-
# so now we need to check contents
|
122
|
-
unless res.empty?
|
123
|
-
msg << ', but such a tag was found'
|
124
|
-
matching = true
|
125
|
-
|
126
|
-
if contents
|
127
|
-
if contents.is_a?(String)
|
128
|
-
if res.inner_html == contents
|
129
|
-
matching = true
|
130
|
-
else
|
131
|
-
msg << " with contents [#{contents.inspect}], but the tag content is [#{res.inner_html}]"
|
132
|
-
matching = false
|
133
|
-
end
|
134
|
-
elsif contents.is_a?(Regexp)
|
135
|
-
if res.inner_html =~ contents
|
136
|
-
matching = true
|
137
|
-
else
|
138
|
-
msg << " with inner_html [#{res.inner_html}],"
|
139
|
-
msg << " but did not match Regexp [#{contents.inspect}]"
|
140
|
-
matching = false
|
141
|
-
end
|
142
|
-
else
|
143
|
-
msg << ", ERROR: contents is neither String nor Regexp, it's [#{contents.class}]"
|
144
|
-
matching = false
|
145
|
-
end
|
146
|
-
else
|
147
|
-
# no contents given, so ignore
|
148
|
-
end
|
149
|
-
|
150
|
-
else
|
151
|
-
# such a tag was found, BAD
|
108
|
+
res = doc.css(expected)
|
109
|
+
|
110
|
+
if res.empty?
|
152
111
|
matching = false
|
112
|
+
else
|
113
|
+
msg << ', but such a tag was found'
|
114
|
+
matching = check_contents(res, contents, msg)
|
153
115
|
end
|
154
116
|
refute matching, msg
|
155
117
|
end
|
156
|
-
|
118
|
+
|
119
|
+
private
|
120
|
+
|
121
|
+
# Builds an error message for tag assertions
|
122
|
+
#
|
123
|
+
# @param msg [String, nil] Custom error message
|
124
|
+
# @param actual [String] The actual HTML content being tested
|
125
|
+
# @param expected [String] The expected tag or selector
|
126
|
+
# @param refute [Boolean] Whether this is for a refutation (default: false)
|
127
|
+
#
|
128
|
+
# @return [String] The formatted error message
|
129
|
+
#
|
130
|
+
def build_message(msg, actual, expected, refute: false)
|
131
|
+
msg = msg.nil? ? '' : "#{msg}\n"
|
132
|
+
msg << "Expected #{actual.inspect} to #{refute ? 'NOT ' : ''}have tag [#{expected.inspect}]"
|
133
|
+
end
|
134
|
+
|
135
|
+
# Checks the contents of the found tag against the expected contents
|
136
|
+
#
|
137
|
+
# @param res [Nokogiri::XML::NodeSet] The result of the CSS selector query
|
138
|
+
# @param contents [String, Regexp, nil] The expected contents of the tag
|
139
|
+
# @param msg [String] The error message to be appended to
|
140
|
+
#
|
141
|
+
# @return [Boolean] True if contents match, false otherwise
|
142
|
+
#
|
143
|
+
def check_contents(res, contents, msg)
|
144
|
+
return true unless contents
|
145
|
+
|
146
|
+
if contents.is_a?(String)
|
147
|
+
check_string_contents(res, contents, msg)
|
148
|
+
elsif contents.is_a?(Regexp)
|
149
|
+
check_regexp_contents(res, contents, msg)
|
150
|
+
else
|
151
|
+
msg << ", ERROR: contents is neither String nor Regexp, it's [#{contents.class}]"
|
152
|
+
false
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
# Checks if the inner HTML of the found tag exactly matches the expected string contents
|
157
|
+
#
|
158
|
+
# @param res [Nokogiri::XML::NodeSet] The result of the CSS selector query
|
159
|
+
# @param contents [String] The expected contents of the tag
|
160
|
+
# @param msg [String] The error message to be appended to
|
161
|
+
#
|
162
|
+
# @return [Boolean] True if contents match exactly, false otherwise
|
163
|
+
#
|
164
|
+
def check_string_contents(res, contents, msg)
|
165
|
+
if res.any? { |tag| tag.inner_html == contents }
|
166
|
+
true
|
167
|
+
else
|
168
|
+
msg << " with contents [#{contents.inspect}], but the tags content found "
|
169
|
+
msg << "is [#{res.map(&:inner_html).join(', ')}]"
|
170
|
+
false
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
# Checks if the inner HTML of the found tag matches the expected regular expression
|
175
|
+
#
|
176
|
+
# @param res [Nokogiri::XML::NodeSet] The result of the CSS selector query
|
177
|
+
# @param contents [Regexp] The expected regular expression to match against the tag's contents
|
178
|
+
# @param msg [String] The error message to be appended to
|
179
|
+
#
|
180
|
+
# @return [Boolean] True if contents match the regular expression, false otherwise
|
181
|
+
#
|
182
|
+
def check_regexp_contents(res, contents, msg)
|
183
|
+
if res.inner_html.match contents
|
184
|
+
true
|
185
|
+
else
|
186
|
+
msg << " with inner_html [#{res.inner_html}],"
|
187
|
+
msg << " but did not match Regexp [#{contents.inspect}]"
|
188
|
+
false
|
189
|
+
end
|
190
|
+
end
|
157
191
|
end
|
192
|
+
# rubocop:enable Style/Documentation
|
158
193
|
|
159
194
|
# add support for Spec syntax
|
160
195
|
module Minitest::Expectations
|
data/minitest-have_tag.gemspec
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
4
|
+
|
3
5
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
6
|
+
|
4
7
|
require 'minitest/have_tag/version'
|
5
8
|
|
6
9
|
Gem::Specification.new do |spec|
|
@@ -9,10 +12,13 @@ Gem::Specification.new do |spec|
|
|
9
12
|
spec.authors = ['Kematzy']
|
10
13
|
spec.email = ['kematzy@gmail.com']
|
11
14
|
|
12
|
-
spec.summary =
|
13
|
-
spec.description =
|
15
|
+
spec.summary = 'Minitest assertions for testing HTML output'
|
16
|
+
spec.description = [
|
17
|
+
'Adds Minitest assertion for testing HTML output, including contents, within a provided string'
|
18
|
+
]
|
14
19
|
spec.homepage = 'http://github.com/kematzy/minitest-have_tag'
|
15
20
|
spec.license = 'MIT'
|
21
|
+
spec.required_ruby_version = '>= 3.0.0'
|
16
22
|
|
17
23
|
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
18
24
|
# delete this section to allow pushing this gem to any host.
|
@@ -26,18 +32,14 @@ Gem::Specification.new do |spec|
|
|
26
32
|
spec.bindir = 'exe'
|
27
33
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
34
|
spec.require_paths = ['lib']
|
29
|
-
|
30
|
-
spec.
|
31
|
-
spec.
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
spec.
|
36
|
-
|
37
|
-
|
38
|
-
spec.
|
39
|
-
spec.add_development_dependency 'minitest-rg'
|
40
|
-
spec.add_development_dependency 'rack-test'
|
41
|
-
spec.add_development_dependency 'simplecov'
|
42
|
-
|
35
|
+
|
36
|
+
spec.platform = Gem::Platform::RUBY
|
37
|
+
spec.extra_rdoc_files = ['README.md', 'LICENSE.txt']
|
38
|
+
spec.rdoc_options += ['--quiet', '--line-numbers', '--inline-source', '--title',
|
39
|
+
'Minitest::HaveTag: assertions for testing HTML output', '--main', 'README.md']
|
40
|
+
|
41
|
+
spec.add_dependency('minitest', '~> 5.7', '>= 5.7.0')
|
42
|
+
spec.add_dependency('nokogiri')
|
43
|
+
|
44
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
43
45
|
end
|
metadata
CHANGED
@@ -1,153 +1,67 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-have_tag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kematzy
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
17
|
+
- - "~>"
|
25
18
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: nokogiri
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
19
|
+
version: '5.7'
|
31
20
|
- - ">="
|
32
21
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
22
|
+
version: 5.7.0
|
34
23
|
type: :runtime
|
35
24
|
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '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: '1.10'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '1.10'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rake
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '10.0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
25
|
version_requirements: !ruby/object:Gem::Requirement
|
65
26
|
requirements:
|
66
27
|
- - "~>"
|
67
28
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: minitest-assert_errors
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: minitest-hooks
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: minitest-rg
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: rack-test
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - ">="
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
29
|
+
version: '5.7'
|
122
30
|
- - ">="
|
123
31
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
32
|
+
version: 5.7.0
|
125
33
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
34
|
+
name: nokogiri
|
127
35
|
requirement: !ruby/object:Gem::Requirement
|
128
36
|
requirements:
|
129
37
|
- - ">="
|
130
38
|
- !ruby/object:Gem::Version
|
131
39
|
version: '0'
|
132
|
-
type: :
|
40
|
+
type: :runtime
|
133
41
|
prerelease: false
|
134
42
|
version_requirements: !ruby/object:Gem::Requirement
|
135
43
|
requirements:
|
136
44
|
- - ">="
|
137
45
|
- !ruby/object:Gem::Version
|
138
46
|
version: '0'
|
139
|
-
description: Adds Minitest assertion for testing HTML output, including contents,
|
140
|
-
within a provided string
|
47
|
+
description: '["Adds Minitest assertion for testing HTML output, including contents,
|
48
|
+
within a provided string"]'
|
141
49
|
email:
|
142
50
|
- kematzy@gmail.com
|
143
51
|
executables: []
|
144
52
|
extensions: []
|
145
|
-
extra_rdoc_files:
|
53
|
+
extra_rdoc_files:
|
54
|
+
- README.md
|
55
|
+
- LICENSE.txt
|
146
56
|
files:
|
57
|
+
- ".github/dependabot.yml"
|
58
|
+
- ".github/workflows/ruby.yml"
|
147
59
|
- ".gitignore"
|
148
|
-
- ".
|
60
|
+
- ".rubocop.yml"
|
61
|
+
- ".rubocop_todo.yml"
|
149
62
|
- CODE_OF_CONDUCT.md
|
150
63
|
- Gemfile
|
64
|
+
- Guardfile
|
151
65
|
- LICENSE.txt
|
152
66
|
- README.md
|
153
67
|
- Rakefile
|
@@ -157,25 +71,32 @@ files:
|
|
157
71
|
homepage: http://github.com/kematzy/minitest-have_tag
|
158
72
|
licenses:
|
159
73
|
- MIT
|
160
|
-
metadata:
|
161
|
-
|
162
|
-
|
74
|
+
metadata:
|
75
|
+
rubygems_mfa_required: 'true'
|
76
|
+
post_install_message:
|
77
|
+
rdoc_options:
|
78
|
+
- "--quiet"
|
79
|
+
- "--line-numbers"
|
80
|
+
- "--inline-source"
|
81
|
+
- "--title"
|
82
|
+
- 'Minitest::HaveTag: assertions for testing HTML output'
|
83
|
+
- "--main"
|
84
|
+
- README.md
|
163
85
|
require_paths:
|
164
86
|
- lib
|
165
87
|
required_ruby_version: !ruby/object:Gem::Requirement
|
166
88
|
requirements:
|
167
89
|
- - ">="
|
168
90
|
- !ruby/object:Gem::Version
|
169
|
-
version:
|
91
|
+
version: 3.0.0
|
170
92
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
171
93
|
requirements:
|
172
94
|
- - ">="
|
173
95
|
- !ruby/object:Gem::Version
|
174
96
|
version: '0'
|
175
97
|
requirements: []
|
176
|
-
|
177
|
-
|
178
|
-
signing_key:
|
98
|
+
rubygems_version: 3.5.16
|
99
|
+
signing_key:
|
179
100
|
specification_version: 4
|
180
101
|
summary: Minitest assertions for testing HTML output
|
181
102
|
test_files: []
|
data/.travis.yml
DELETED