typ-rspec-matcher 0.1.0 → 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.lock +10 -8
- data/lib/typ/rspec/matcher/pose.rb +12 -2
- data/lib/typ/rspec/matcher.rb +3 -2
- data/spec/Matcher_spec.rb +0 -5
- data/spec/helper.rb +5 -0
- data/spec/pose_spec.rb +20 -0
- data/typ-rspec-matcher.gemspec +6 -6
- metadata +16 -15
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.lock
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
typ-rspec-matcher (0.1.
|
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/
|
@@ -31,10 +31,12 @@ GEM
|
|
31
31
|
rspec-support (~> 3.12.0)
|
32
32
|
rspec-support (3.12.1)
|
33
33
|
string-indent (0.0.1)
|
34
|
-
typ (0.
|
35
|
-
typ-formatter (0.
|
36
|
-
|
37
|
-
|
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)
|
38
40
|
|
39
41
|
PLATFORMS
|
40
42
|
x86_64-linux
|
@@ -1,5 +1,15 @@
|
|
1
|
+
require 'typ'
|
1
2
|
require_relative '../matcher'
|
2
3
|
|
3
|
-
def pose typ_class
|
4
|
-
|
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
|
5
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/spec/Matcher_spec.rb
CHANGED
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,12 +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.1.
|
5
|
-
g.summary = 'A RSpec matcher to
|
4
|
+
g.version = '0.1.1'
|
5
|
+
g.summary = 'A RSpec matcher to pose.'
|
6
6
|
g.authors = ['Anatoly Chernov']
|
7
|
-
g.email = [
|
7
|
+
g.email = ['chertoly@gmail.com']
|
8
8
|
|
9
|
-
g.add_dependency 'awesome_print'
|
10
|
-
g.add_dependency 'typ-formatter'
|
11
|
-
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'
|
12
12
|
end
|
metadata
CHANGED
@@ -1,57 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: typ-rspec-matcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anatoly Chernov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
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
56
|
email:
|
57
57
|
- chertoly@gmail.com
|
@@ -66,6 +66,7 @@ files:
|
|
66
66
|
- readme.adoc
|
67
67
|
- spec/Matcher_spec.rb
|
68
68
|
- spec/helper.rb
|
69
|
+
- spec/pose_spec.rb
|
69
70
|
- typ-rspec-matcher.gemspec
|
70
71
|
homepage:
|
71
72
|
licenses: []
|
@@ -88,5 +89,5 @@ requirements: []
|
|
88
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: []
|