rspec-graphql_matchers 1.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +6 -0
- data/lib/rspec/graphql_matchers/be_of_type.rb +11 -1
- data/lib/rspec/graphql_matchers/have_a_field.rb +4 -2
- data/lib/rspec/graphql_matchers/version.rb +3 -1
- data/rspec-graphql_matchers.gemspec +3 -3
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e1b62f5a95d20257f842b982b96dee3ffbfd0ecdaebc39ce9dabbdce6fe6353
|
4
|
+
data.tar.gz: ac281e27a9cd7a390ede1fbd2e45d508d62ea6438e343c80c2967aa2cd4d6b29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c668b061318cdc940fc0045338163ea132271b508383ebc71eed113139b4286b25a275c68a5c90b21a8e4b25ae87227832dc33d021f218fe7322d01da87bb45f
|
7
|
+
data.tar.gz: 7a6932601fc8bcf5d163bb0040d696b88d6dbc77c838a1dc25d9479accf23b470e25b72f93c4ddd07906e7a723f3bc003ef61f289a27f580951f3ec60de61dd4
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -8,6 +8,12 @@
|
|
8
8
|
|
9
9
|
### Bug fixes
|
10
10
|
|
11
|
+
## 1.0.1 (June 22th, 2019)
|
12
|
+
|
13
|
+
### Bug fixes
|
14
|
+
|
15
|
+
- Fixed issue causing `have_a_field(x).of_type(Y)` to fail on fields defined on implemented interfaces that were defined with legacy syntax.
|
16
|
+
|
11
17
|
## 1.0 (June, 2019)
|
12
18
|
|
13
19
|
### Breaking changes
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'base_matcher'
|
2
4
|
require 'pry'
|
3
5
|
|
@@ -11,7 +13,7 @@ module RSpec
|
|
11
13
|
end
|
12
14
|
|
13
15
|
def matches?(actual_sample)
|
14
|
-
@sample = actual_sample
|
16
|
+
@sample = to_graphql(actual_sample)
|
15
17
|
sample.respond_to?(:type) && types_match?(sample.type, @expected)
|
16
18
|
end
|
17
19
|
|
@@ -23,6 +25,14 @@ module RSpec
|
|
23
25
|
def description
|
24
26
|
"be of type '#{expected}'"
|
25
27
|
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def to_graphql(field_sample)
|
32
|
+
return field_sample unless field_sample.respond_to?(:to_graphql)
|
33
|
+
|
34
|
+
field_sample.to_graphql
|
35
|
+
end
|
26
36
|
end
|
27
37
|
end
|
28
38
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'base_matcher'
|
2
4
|
require_relative './have_a_field_matchers/of_type'
|
3
5
|
require_relative './have_a_field_matchers/with_property'
|
@@ -19,8 +21,8 @@ module RSpec
|
|
19
21
|
@actual_field = field_collection[@expected_field_name]
|
20
22
|
return false if @actual_field.nil?
|
21
23
|
|
22
|
-
@results = @expectations.
|
23
|
-
|
24
|
+
@results = @expectations.reject do |matcher|
|
25
|
+
matcher.matches?(@actual_field)
|
24
26
|
end
|
25
27
|
|
26
28
|
@results.empty?
|
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
lib = File.expand_path('
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
5
|
require 'rspec/graphql_matchers/version'
|
6
6
|
|
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
|
28
28
|
spec.add_runtime_dependency 'graphql', '>= 1.8', '< 1.9'
|
29
29
|
spec.add_development_dependency 'bundler', '~> 1.12'
|
30
|
-
spec.add_development_dependency 'rubocop', '
|
30
|
+
spec.add_development_dependency 'rubocop', '0.71'
|
31
31
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
32
32
|
spec.add_development_dependency 'pry', '~> 0'
|
33
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-graphql_matchers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Brandão
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|
@@ -48,16 +48,16 @@ dependencies:
|
|
48
48
|
name: rubocop
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- -
|
51
|
+
- - '='
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '0'
|
53
|
+
version: '0.71'
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
|
-
- -
|
58
|
+
- - '='
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '0'
|
60
|
+
version: '0.71'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: rspec
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|