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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d19eb108a03226d730c4ef1cc10afe2b54e2ae3e922e9617cd8d69dec4650d26
4
- data.tar.gz: 49882ece0fb24f10899e6f4f923c2c639d9859ec6309c46135e7c3ea6f486a51
3
+ metadata.gz: 1e1b62f5a95d20257f842b982b96dee3ffbfd0ecdaebc39ce9dabbdce6fe6353
4
+ data.tar.gz: ac281e27a9cd7a390ede1fbd2e45d508d62ea6438e343c80c2967aa2cd4d6b29
5
5
  SHA512:
6
- metadata.gz: b0f0ec4e822a9ba1ae174edace4b3a77d76ece28df8c46fe128b75d02e97652191506890be7101c52b8c32644a6e48d401bf623c69a6fc60d81a434063281ae9
7
- data.tar.gz: 56c4388cfa19bcc95967e2f16ec726a49a935c5ecccf5f30ae722384283cecac29ba3409c21dd925f40683f55f5d2fef7aa2ec872834980477498e7d015f619a
6
+ metadata.gz: c668b061318cdc940fc0045338163ea132271b508383ebc71eed113139b4286b25a275c68a5c90b21a8e4b25ae87227832dc33d021f218fe7322d01da87bb45f
7
+ data.tar.gz: 7a6932601fc8bcf5d163bb0040d696b88d6dbc77c838a1dc25d9479accf23b470e25b72f93c4ddd07906e7a723f3bc003ef61f289a27f580951f3ec60de61dd4
data/.travis.yml CHANGED
@@ -3,4 +3,4 @@ language: ruby
3
3
  rvm:
4
4
  - 2.3.1
5
5
  before_install: gem install bundler -v 1.12.3
6
- script: bundle exec rake
6
+ script: bundle exec rspec
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.select do |matcher|
23
- !matcher.matches?(@actual_field)
24
+ @results = @expectations.reject do |matcher|
25
+ matcher.matches?(@actual_field)
24
26
  end
25
27
 
26
28
  @results.empty?
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Rspec
2
4
  module GraphqlMatchers
3
- VERSION = '1.0'.freeze
5
+ VERSION = '1.0.1'
4
6
  end
5
7
  end
@@ -1,6 +1,6 @@
1
- # coding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('../lib', __FILE__)
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', '~> 0'
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: '1.0'
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-19 00:00:00.000000000 Z
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