rspec-graphql_matchers 1.0.1 → 1.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 +6 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile +6 -0
- data/lib/rspec/graphql_matchers/be_of_type.rb +0 -1
- data/lib/rspec/graphql_matchers/have_a_field.rb +1 -0
- data/lib/rspec/graphql_matchers/have_a_field_matchers/with_hash_key.rb +2 -3
- data/lib/rspec/graphql_matchers/have_a_field_matchers/with_property.rb +9 -1
- data/lib/rspec/graphql_matchers/version.rb +1 -1
- data/rspec-graphql_matchers.gemspec +1 -1
- metadata +4 -5
- data/rspec-graphql_matchers-1.0.0.pre.0.1.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95bbde7e6185bd3338294aa487a1f3cfaa794e2f94203f610d3c23f43577a858
|
4
|
+
data.tar.gz: de25f9532825e473237eab0d711d2991b5553a01749e355d5479d98b5c9b0ce8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98947628be39f759fadce2d0febff1761bf7027367bd82d402e9516e4f445d1eff3400bf1de485379949d1bb04a663d6c49e21cc40c293df1b5e8d3249cdaa22
|
7
|
+
data.tar.gz: 2bac7a4a9d4e1355da652cdd07b643c5741a7cfcc57bc7b4dfb1bce85bb0586b2f9c8072b9030bfecb8a84fbf91eef6c81f37b1d12fd14f821c088a55d54f04b
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -19,6 +19,7 @@ module RSpec
|
|
19
19
|
@graph_object = graph_object
|
20
20
|
|
21
21
|
@actual_field = field_collection[@expected_field_name]
|
22
|
+
@actual_field = @actual_field.to_graphql if @actual_field.respond_to?(:to_graphql)
|
22
23
|
return false if @actual_field.nil?
|
23
24
|
|
24
25
|
@results = @expectations.reject do |matcher|
|
@@ -23,11 +23,10 @@ module RSpec
|
|
23
23
|
|
24
24
|
def get_hash_key(actual_field)
|
25
25
|
if actual_field.respond_to?(:hash_key)
|
26
|
-
return actual_field.hash_key.to_sym
|
26
|
+
return actual_field.hash_key.to_sym if actual_field.hash_key
|
27
27
|
end
|
28
28
|
|
29
|
-
|
30
|
-
actual_field.method_sym
|
29
|
+
actual_field.metadata[:type_class].method_sym
|
31
30
|
end
|
32
31
|
end
|
33
32
|
end
|
@@ -11,13 +11,21 @@ module RSpec
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def matches?(actual_field)
|
14
|
-
@actual_property = actual_field.
|
14
|
+
@actual_property = property(actual_field).to_sym
|
15
15
|
@actual_property == @expected_property_name.to_sym
|
16
16
|
end
|
17
17
|
|
18
18
|
def failure_message
|
19
19
|
"#{description}, but it was `#{@actual_property}`"
|
20
20
|
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def property(field)
|
25
|
+
property = field.property
|
26
|
+
property = field.metadata[:type_class].method_sym if property.nil?
|
27
|
+
property
|
28
|
+
end
|
21
29
|
end
|
22
30
|
end
|
23
31
|
end
|
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
26
26
|
spec.require_paths = ['lib']
|
27
27
|
|
28
|
-
spec.add_runtime_dependency 'graphql', '>= 1.8', '<
|
28
|
+
spec.add_runtime_dependency 'graphql', '>= 1.8', '< 2.0'
|
29
29
|
spec.add_development_dependency 'bundler', '~> 1.12'
|
30
30
|
spec.add_development_dependency 'rubocop', '0.71'
|
31
31
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
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: 1.
|
4
|
+
version: '1.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-
|
11
|
+
date: 2019-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '1.8'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '2.0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '1.8'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '2.0'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: bundler
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -121,7 +121,6 @@ files:
|
|
121
121
|
- lib/rspec/graphql_matchers/matchers.rb
|
122
122
|
- lib/rspec/graphql_matchers/types_helper.rb
|
123
123
|
- lib/rspec/graphql_matchers/version.rb
|
124
|
-
- rspec-graphql_matchers-1.0.0.pre.0.1.gem
|
125
124
|
- rspec-graphql_matchers.gemspec
|
126
125
|
homepage: https://github.com/khamusa/rspec-graphql_matchers
|
127
126
|
licenses:
|
Binary file
|