typ-rspec-matcher 0.1.0 → 0.1.2
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: f6085c7421c3435ff46e09b6d960233bb69134963aa7b050dbc1d7af6fdcbd48
|
4
|
+
data.tar.gz: 2c7bd1be40cf6248ade08de93d580e264229191ef33e89e3a8c8d9edb3740e68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c21501704a30cbe6ecb1482df09e01c41b601af0775847fd4ff59bf14695a2ae2505301ff3db671a7e0b6854433193cbb674b2d8b190ad90d41d6ca0450f7242
|
7
|
+
data.tar.gz: 0fb026184f2def3cf4fe1f69211d58e11edc192dc309385ae8023fe27070550518aa5a1ae72b29b4d9d76b6e4da656bd56bd4969cf135bba02a3a5ef899b7c65
|
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.2)
|
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 += @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.2'
|
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.2
|
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-09 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: []
|