rspec-match_fuzzy 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/dependabot.yml +14 -0
- data/.github/workflows/ci.yml +31 -0
- data/.rubocop.yml +14 -0
- data/Gemfile +2 -0
- data/README.md +2 -2
- data/Rakefile +8 -1
- data/bin/console +4 -3
- data/lib/rspec/match_fuzzy.rb +6 -8
- data/rspec-match_fuzzy.gemspec +11 -6
- metadata +54 -10
- data/.travis.yml +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e7ea4c115f85e3586c39c5386a8812375a0f064c65e74bda3d6a2525ae7b6ba9
|
4
|
+
data.tar.gz: 652d04bdc0743bfa108ce91a2d3de74242c4cb339be1aba9ccfc9220ca7a72de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69242b59e50e0b32f00f98232456c2daa76dccca370d9d20ee2f0697f82afa8ff6dd9e8e845b6c9bc1e75c2cd8c4b1e52bf24d8091078b821355d3601aeb6604
|
7
|
+
data.tar.gz: 419bb690129e3519fb3e73619e29ef5256dbc1e8a25a658ce2706c1c12b14bf2bbea13e16c0ed87440b62469f1f91e73d32a9cffbc106466949e1086e0541a4d
|
@@ -0,0 +1,31 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: ["master"]
|
6
|
+
pull_request:
|
7
|
+
|
8
|
+
permissions:
|
9
|
+
contents: read
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
test:
|
13
|
+
runs-on: ubuntu-latest
|
14
|
+
strategy:
|
15
|
+
matrix:
|
16
|
+
ruby-version:
|
17
|
+
- "2.7"
|
18
|
+
- "3.0"
|
19
|
+
- "3.1"
|
20
|
+
- "3.2"
|
21
|
+
- "3.3"
|
22
|
+
|
23
|
+
steps:
|
24
|
+
- uses: actions/checkout@v3
|
25
|
+
- name: Set up Ruby
|
26
|
+
uses: ruby/setup-ruby@v1
|
27
|
+
with:
|
28
|
+
ruby-version: ${{ matrix.ruby-version }}
|
29
|
+
bundler-cache: true
|
30
|
+
- name: Run tests
|
31
|
+
run: bundle exec rake
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
AllCops:
|
2
|
+
SuggestExtensions: false
|
3
|
+
NewCops: enable
|
4
|
+
Exclude:
|
5
|
+
- "gemfiles/**/*"
|
6
|
+
- "vendor/bundle/**/*"
|
7
|
+
Naming/HeredocDelimiterNaming:
|
8
|
+
Enabled: false
|
9
|
+
Metrics/BlockLength:
|
10
|
+
Enabled: false
|
11
|
+
Gemspec/RequiredRubyVersion:
|
12
|
+
Enabled: false
|
13
|
+
Gemspec/DevelopmentDependencies:
|
14
|
+
Enabled: false
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# rspec-match_fuzzy
|
2
2
|
|
3
|
-
|
3
|
+
[![CI](https://github.com/winebarrel/rspec-match_fuzzy/actions/workflows/ci.yml/badge.svg)](https://github.com/winebarrel/rspec-match_fuzzy/actions/workflows/ci.yml)
|
4
4
|
|
5
|
-
|
5
|
+
String matcher to ignore whitespace.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
data/Rakefile
CHANGED
@@ -1,6 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'bundler/gem_tasks'
|
2
4
|
require 'rspec/core/rake_task'
|
5
|
+
require 'rubocop/rake_task'
|
3
6
|
|
4
7
|
RSpec::Core::RakeTask.new(:spec)
|
5
8
|
|
6
|
-
|
9
|
+
RuboCop::RakeTask.new do |task|
|
10
|
+
task.options = %w[-c .rubocop.yml]
|
11
|
+
end
|
12
|
+
|
13
|
+
task default: %i[rubocop spec]
|
data/bin/console
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
|
-
require
|
4
|
-
require
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'rspec/match_fuzzy'
|
5
6
|
|
6
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
8
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +11,5 @@ require "rspec/match_fuzzy"
|
|
10
11
|
# require "pry"
|
11
12
|
# Pry.start
|
12
13
|
|
13
|
-
require
|
14
|
+
require 'irb'
|
14
15
|
IRB.start
|
data/lib/rspec/match_fuzzy.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rspec'
|
2
4
|
|
3
5
|
RSpec::Matchers.define :match_fuzzy do |expected|
|
4
6
|
expected = expected.to_s
|
5
|
-
|
6
7
|
match do |actual|
|
7
8
|
actual = actual.to_s
|
8
9
|
actual.strip.gsub(/[[:blank:]]+/, '').gsub(/\n+/, "\n") == expected.strip.gsub(/[[:blank:]]+/, '').gsub(/\n+/, "\n")
|
@@ -13,17 +14,14 @@ RSpec::Matchers.define :match_fuzzy do |expected|
|
|
13
14
|
actual_normalized = actual.strip.gsub(/^\s+/, '').gsub(/[[:blank:]]+/, "\s").gsub(/\n+/, "\n").gsub(/\s+$/, '')
|
14
15
|
expected_normalized = expected.strip.gsub(/^\s+/, '').gsub(/[[:blank:]]+/, "\s").gsub(/\n+/, "\n").gsub(/\s+$/, '')
|
15
16
|
|
16
|
-
message =
|
17
|
-
expected: #{expected_normalized.inspect}
|
18
|
-
|
17
|
+
message = <<~EOS.strip
|
18
|
+
expected: #{expected_normalized.inspect}
|
19
|
+
got: #{actual_normalized.inspect}
|
19
20
|
EOS
|
20
21
|
|
21
22
|
diff = RSpec::Expectations.differ.diff(actual_normalized, expected_normalized)
|
22
23
|
|
23
|
-
unless diff.strip.empty?
|
24
|
-
diff_label = RSpec::Matchers::ExpectedsForMultipleDiffs::DEFAULT_DIFF_LABEL
|
25
|
-
message << "\n\n" << diff_label << diff
|
26
|
-
end
|
24
|
+
message << "\n\n" << 'Diff:' << diff unless diff.strip.empty?
|
27
25
|
|
28
26
|
message
|
29
27
|
end
|
data/rspec-match_fuzzy.gemspec
CHANGED
@@ -1,13 +1,14 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
2
3
|
Gem::Specification.new do |spec|
|
3
4
|
spec.name = 'rspec-match_fuzzy'
|
4
|
-
spec.version = '0.
|
5
|
+
spec.version = '0.2.0'
|
5
6
|
spec.authors = ['winebarrel']
|
6
|
-
spec.email = ['
|
7
|
+
spec.email = ['sugawara@winebarrel.jp']
|
7
8
|
|
8
|
-
spec.summary =
|
9
|
-
spec.description =
|
10
|
-
spec.homepage =
|
9
|
+
spec.summary = 'String matcher to ignore whitespace.'
|
10
|
+
spec.description = 'String matcher to ignore whitespace.'
|
11
|
+
spec.homepage = 'https://github.com/winebarrel/rspec-match_fuzzy'
|
11
12
|
spec.license = 'MIT'
|
12
13
|
|
13
14
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
@@ -18,4 +19,8 @@ Gem::Specification.new do |spec|
|
|
18
19
|
spec.add_dependency 'rspec', '>= 3.2'
|
19
20
|
spec.add_development_dependency 'bundler'
|
20
21
|
spec.add_development_dependency 'rake'
|
22
|
+
spec.add_development_dependency 'rubocop', '1.60.2'
|
23
|
+
spec.add_development_dependency 'rubocop-rake', '>= 0.5.1'
|
24
|
+
spec.add_development_dependency 'rubocop-rspec', '>= 2.1.0'
|
25
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
21
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-match_fuzzy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- winebarrel
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -52,16 +52,60 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.60.2
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.60.2
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop-rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.5.1
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.5.1
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop-rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 2.1.0
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 2.1.0
|
55
97
|
description: String matcher to ignore whitespace.
|
56
98
|
email:
|
57
|
-
-
|
99
|
+
- sugawara@winebarrel.jp
|
58
100
|
executables: []
|
59
101
|
extensions: []
|
60
102
|
extra_rdoc_files: []
|
61
103
|
files:
|
104
|
+
- ".github/dependabot.yml"
|
105
|
+
- ".github/workflows/ci.yml"
|
62
106
|
- ".gitignore"
|
63
107
|
- ".rspec"
|
64
|
-
- ".
|
108
|
+
- ".rubocop.yml"
|
65
109
|
- Gemfile
|
66
110
|
- LICENSE.txt
|
67
111
|
- README.md
|
@@ -73,8 +117,9 @@ files:
|
|
73
117
|
homepage: https://github.com/winebarrel/rspec-match_fuzzy
|
74
118
|
licenses:
|
75
119
|
- MIT
|
76
|
-
metadata:
|
77
|
-
|
120
|
+
metadata:
|
121
|
+
rubygems_mfa_required: 'true'
|
122
|
+
post_install_message:
|
78
123
|
rdoc_options: []
|
79
124
|
require_paths:
|
80
125
|
- lib
|
@@ -89,9 +134,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
134
|
- !ruby/object:Gem::Version
|
90
135
|
version: '0'
|
91
136
|
requirements: []
|
92
|
-
|
93
|
-
|
94
|
-
signing_key:
|
137
|
+
rubygems_version: 3.4.10
|
138
|
+
signing_key:
|
95
139
|
specification_version: 4
|
96
140
|
summary: String matcher to ignore whitespace.
|
97
141
|
test_files: []
|