typ-rspec-matcher 0.0.3 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -4
- data/Gemfile.lock +31 -95
- data/lib/typ/rspec/matcher/pose.rb +15 -0
- data/lib/typ/rspec/matcher.rb +3 -2
- data/readme.adoc +0 -7
- data/spec/Matcher_spec.rb +1 -6
- data/spec/helper.rb +5 -0
- data/spec/pose_spec.rb +20 -0
- data/typ-rspec-matcher.gemspec +7 -6
- metadata +21 -20
- data/lib/typ/rspec/matcher/with_method.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12741fbb87175af439f07c02fb1c7d1082379bd534abe077427e9bff60e00dd9
|
4
|
+
data.tar.gz: 8f05cc309f2f5a6181280a6569ee8ea9710024ae7e9c74ead82a24269032d4a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70320ba96abdfe9b11c2a794447a57934680f63a867c349c00474d7c42fcd626b17bb8f638b38a0fd6390ba7d1a2d22b73d6656da0139f2462be9e46e137c922
|
7
|
+
data.tar.gz: a726623b6a07047b14fbfb0aa46dd2253ebd69cb2128f8fc4e43898151d14b68987b5f9ef028f0c15b3fe8d2be58b78e961cb2404ab174cd2a7d60047bb5ed3d
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,115 +1,51 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
typ-rspec-matcher (0.
|
5
|
-
awesome_print
|
6
|
-
typ
|
7
|
-
typ-formatter
|
4
|
+
typ-rspec-matcher (0.1.1)
|
5
|
+
awesome_print (~> 1.9.2)
|
6
|
+
typ (~> 0.1.2)
|
7
|
+
typ-formatter (~> 0.1.2)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
diff-lcs (1.3)
|
28
|
-
equalizer (0.0.11)
|
29
|
-
ice_nine (0.11.2)
|
30
|
-
memoizable (0.4.2)
|
31
|
-
thread_safe (~> 0.3, >= 0.3.1)
|
32
|
-
method_source (0.9.0)
|
33
|
-
morpher (0.2.6)
|
34
|
-
abstract_type (~> 0.0.7)
|
35
|
-
adamantium (~> 0.2.0)
|
36
|
-
anima (~> 0.3.0)
|
37
|
-
ast (~> 2.2)
|
38
|
-
concord (~> 0.1.5)
|
39
|
-
equalizer (~> 0.0.9)
|
40
|
-
ice_nine (~> 0.11.0)
|
41
|
-
procto (~> 0.0.2)
|
42
|
-
mutant (0.8.14)
|
43
|
-
abstract_type (~> 0.0.7)
|
44
|
-
adamantium (~> 0.2.0)
|
45
|
-
anima (~> 0.3.0)
|
46
|
-
ast (~> 2.2)
|
47
|
-
concord (~> 0.1.5)
|
48
|
-
diff-lcs (~> 1.3)
|
49
|
-
equalizer (~> 0.0.9)
|
50
|
-
ice_nine (~> 0.11.1)
|
51
|
-
memoizable (~> 0.4.2)
|
52
|
-
morpher (~> 0.2.6)
|
53
|
-
parallel (~> 1.3)
|
54
|
-
parser (>= 2.3.1.4, < 2.5)
|
55
|
-
procto (~> 0.0.2)
|
56
|
-
regexp_parser (~> 0.4.3)
|
57
|
-
unparser (~> 0.2.5)
|
58
|
-
mutant-rspec (0.8.14)
|
59
|
-
mutant (~> 0.8.14)
|
60
|
-
rspec-core (>= 3.4.0, < 3.7.0)
|
61
|
-
parallel (1.12.1)
|
62
|
-
parser (2.4.0.2)
|
63
|
-
ast (~> 2.3)
|
64
|
-
procto (0.0.3)
|
65
|
-
pry (0.11.3)
|
66
|
-
coderay (~> 1.1.0)
|
67
|
-
method_source (~> 0.9.0)
|
68
|
-
pry-byebug (3.6.0)
|
69
|
-
byebug (~> 10.0)
|
70
|
-
pry (~> 0.10)
|
71
|
-
rainbow (3.0.0)
|
72
|
-
regexp_parser (0.4.13)
|
73
|
-
rspec (3.6.0)
|
74
|
-
rspec-core (~> 3.6.0)
|
75
|
-
rspec-expectations (~> 3.6.0)
|
76
|
-
rspec-mocks (~> 3.6.0)
|
77
|
-
rspec-core (3.6.0)
|
78
|
-
rspec-support (~> 3.6.0)
|
79
|
-
rspec-expectations (3.6.0)
|
12
|
+
awesome_print (1.9.2)
|
13
|
+
coderay (1.1.3)
|
14
|
+
diff-lcs (1.5.0)
|
15
|
+
method_source (1.0.0)
|
16
|
+
pry (0.14.2)
|
17
|
+
coderay (~> 1.1)
|
18
|
+
method_source (~> 1.0)
|
19
|
+
rainbow (3.1.1)
|
20
|
+
rspec (3.12.0)
|
21
|
+
rspec-core (~> 3.12.0)
|
22
|
+
rspec-expectations (~> 3.12.0)
|
23
|
+
rspec-mocks (~> 3.12.0)
|
24
|
+
rspec-core (3.12.2)
|
25
|
+
rspec-support (~> 3.12.0)
|
26
|
+
rspec-expectations (3.12.3)
|
80
27
|
diff-lcs (>= 1.2.0, < 2.0)
|
81
|
-
rspec-support (~> 3.
|
82
|
-
rspec-mocks (3.6
|
28
|
+
rspec-support (~> 3.12.0)
|
29
|
+
rspec-mocks (3.12.6)
|
83
30
|
diff-lcs (>= 1.2.0, < 2.0)
|
84
|
-
rspec-support (~> 3.
|
85
|
-
rspec-support (3.
|
31
|
+
rspec-support (~> 3.12.0)
|
32
|
+
rspec-support (3.12.1)
|
86
33
|
string-indent (0.0.1)
|
87
|
-
|
88
|
-
typ (0.
|
89
|
-
|
90
|
-
rainbow
|
91
|
-
string-indent
|
92
|
-
|
93
|
-
abstract_type (~> 0.0.7)
|
94
|
-
adamantium (~> 0.2.0)
|
95
|
-
concord (~> 0.1.5)
|
96
|
-
diff-lcs (~> 1.3)
|
97
|
-
equalizer (~> 0.0.9)
|
98
|
-
parser (>= 2.3.1.2, < 2.6)
|
99
|
-
procto (~> 0.0.2)
|
34
|
+
typ (0.1.2)
|
35
|
+
typ-formatter (0.1.2)
|
36
|
+
awesome_print (~> 1.9.2)
|
37
|
+
rainbow (~> 3.1.1)
|
38
|
+
string-indent (~> 0.0.1)
|
39
|
+
typ (>= 0.1.2)
|
100
40
|
|
101
41
|
PLATFORMS
|
102
|
-
|
42
|
+
x86_64-linux
|
103
43
|
|
104
44
|
DEPENDENCIES
|
105
45
|
awesome_print
|
106
|
-
byebug
|
107
|
-
mutant
|
108
|
-
mutant-rspec
|
109
46
|
pry
|
110
|
-
pry-byebug
|
111
47
|
rspec
|
112
48
|
typ-rspec-matcher!
|
113
49
|
|
114
50
|
BUNDLED WITH
|
115
|
-
|
51
|
+
2.4.15
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'typ'
|
2
|
+
require_relative '../matcher'
|
3
|
+
|
4
|
+
def pose typ_class = nil, &block
|
5
|
+
typ_class ||= Class.new do
|
6
|
+
include Typ
|
7
|
+
end
|
8
|
+
|
9
|
+
if block_given?
|
10
|
+
typ_class.instance_exec &block
|
11
|
+
Typ::RSpec::Matcher.new typ_class, ' pose'
|
12
|
+
else
|
13
|
+
Typ::RSpec::Matcher.new typ_class
|
14
|
+
end
|
15
|
+
end
|
data/lib/typ/rspec/matcher.rb
CHANGED
@@ -4,13 +4,14 @@ require 'typ/formatter'
|
|
4
4
|
module Typ
|
5
5
|
module RSpec
|
6
6
|
class Matcher
|
7
|
-
def initialize typ_class
|
8
|
-
@typ_class = typ_class
|
7
|
+
def initialize typ_class, name_appendix = nil
|
8
|
+
@typ_class, @name_appendix = typ_class, name_appendix
|
9
9
|
end
|
10
10
|
|
11
11
|
def matches? it
|
12
12
|
@it = it
|
13
13
|
@typ = @typ_class.new it
|
14
|
+
(@typ.name = @typ.name + @name_appendix) if @name_appendix
|
14
15
|
@typ.ok?
|
15
16
|
end
|
16
17
|
|
data/readme.adoc
CHANGED
data/spec/Matcher_spec.rb
CHANGED
@@ -1,10 +1,5 @@
|
|
1
1
|
require_relative 'helper'
|
2
2
|
|
3
|
-
class Positive
|
4
|
-
include Typ
|
5
|
-
is [:>, 0]
|
6
|
-
end
|
7
|
-
|
8
3
|
describe Typ::RSpec::Matcher do
|
9
4
|
let(:matcher) { described_class.new Positive }
|
10
5
|
|
@@ -13,7 +8,7 @@ describe Typ::RSpec::Matcher do
|
|
13
8
|
expect(bool).to be false
|
14
9
|
|
15
10
|
failure_message = <<~S.chomp
|
16
|
-
-1
|
11
|
+
\e[1;34m-1\e[0m
|
17
12
|
#{Rainbow(Positive).red}
|
18
13
|
#{Rainbow('is [:>, 0]').red}
|
19
14
|
S
|
data/spec/helper.rb
CHANGED
data/spec/pose_spec.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require_relative 'helper'
|
2
|
+
require 'typ/rspec/matcher/pose'
|
3
|
+
|
4
|
+
describe 'pose' do
|
5
|
+
it 'works without a block' do
|
6
|
+
c = Class.new do
|
7
|
+
include Typ
|
8
|
+
is [:>, 0]
|
9
|
+
end
|
10
|
+
|
11
|
+
expect(1).to pose c
|
12
|
+
expect(1).to pose Positive
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'works with a block' do
|
16
|
+
expect(1).to pose {
|
17
|
+
is [:>, 0]
|
18
|
+
}
|
19
|
+
end
|
20
|
+
end
|
data/typ-rspec-matcher.gemspec
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
Gem::Specification.new do |g|
|
2
2
|
g.name = 'typ-rspec-matcher'
|
3
3
|
g.files = `git ls-files`.split($/)
|
4
|
-
g.version = '0.
|
5
|
-
g.summary = 'A RSpec matcher to
|
6
|
-
g.authors = ['Anatoly
|
4
|
+
g.version = '0.1.1'
|
5
|
+
g.summary = 'A RSpec matcher to pose.'
|
6
|
+
g.authors = ['Anatoly Chernov']
|
7
|
+
g.email = ['chertoly@gmail.com']
|
7
8
|
|
8
|
-
g.add_dependency 'awesome_print'
|
9
|
-
g.add_dependency 'typ-formatter'
|
10
|
-
g.add_dependency 'typ'
|
9
|
+
g.add_dependency 'awesome_print', '~> 1.9.2'
|
10
|
+
g.add_dependency 'typ-formatter', '~> 0.1.2'
|
11
|
+
g.add_dependency 'typ', '~> 0.1.2'
|
11
12
|
end
|
metadata
CHANGED
@@ -1,59 +1,60 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: typ-rspec-matcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Anatoly
|
7
|
+
- Anatoly Chernov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.9.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 1.9.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: typ-formatter
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.1.2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 0.1.2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: typ
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 0.1.2
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 0.1.2
|
55
55
|
description:
|
56
|
-
email:
|
56
|
+
email:
|
57
|
+
- chertoly@gmail.com
|
57
58
|
executables: []
|
58
59
|
extensions: []
|
59
60
|
extra_rdoc_files: []
|
@@ -61,10 +62,11 @@ files:
|
|
61
62
|
- Gemfile
|
62
63
|
- Gemfile.lock
|
63
64
|
- lib/typ/rspec/matcher.rb
|
64
|
-
- lib/typ/rspec/matcher/
|
65
|
+
- lib/typ/rspec/matcher/pose.rb
|
65
66
|
- readme.adoc
|
66
67
|
- spec/Matcher_spec.rb
|
67
68
|
- spec/helper.rb
|
69
|
+
- spec/pose_spec.rb
|
68
70
|
- typ-rspec-matcher.gemspec
|
69
71
|
homepage:
|
70
72
|
licenses: []
|
@@ -84,9 +86,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
86
|
- !ruby/object:Gem::Version
|
85
87
|
version: '0'
|
86
88
|
requirements: []
|
87
|
-
|
88
|
-
rubygems_version: 2.7.6
|
89
|
+
rubygems_version: 3.4.15
|
89
90
|
signing_key:
|
90
91
|
specification_version: 4
|
91
|
-
summary: A RSpec matcher to
|
92
|
+
summary: A RSpec matcher to pose.
|
92
93
|
test_files: []
|