rspec-graphql_matchers 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rspec.yml +41 -0
- data/.rubocop.yml +12 -15
- data/CHANGELOG.md +3 -0
- data/Gemfile +4 -0
- data/README.md +1 -1
- data/Rakefile +2 -0
- data/bin/console +1 -0
- data/lib/rspec/graphql_matchers/accept_argument.rb +4 -2
- data/lib/rspec/graphql_matchers/accept_arguments.rb +2 -0
- data/lib/rspec/graphql_matchers/base_matcher.rb +2 -0
- data/lib/rspec/graphql_matchers/have_a_field_matchers/of_type.rb +2 -0
- data/lib/rspec/graphql_matchers/have_a_field_matchers/with_hash_key.rb +2 -0
- data/lib/rspec/graphql_matchers/have_a_field_matchers/with_metadata.rb +2 -0
- data/lib/rspec/graphql_matchers/have_a_field_matchers/with_property.rb +2 -0
- data/lib/rspec/graphql_matchers/implement.rb +3 -1
- data/lib/rspec/graphql_matchers/matchers.rb +5 -2
- data/lib/rspec/graphql_matchers/types_helper.rb +2 -0
- data/lib/rspec/graphql_matchers/version.rb +1 -1
- data/lib/rspec/graphql_matchers.rb +2 -0
- data/rspec-graphql_matchers.gemspec +5 -3
- metadata +30 -17
- data/.travis.yml +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfc59ebc6b348aeab1defdb0057751774ea69653260195b26e9a95363f86430a
|
4
|
+
data.tar.gz: a23a3d725d3e0f2fa8136f7ab9b74efeb411a6e3d0e36e683ae5e99268bb08c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcd1bd614c785d6f2d5aee1a444c28af584ebf518ecce0706bb7949bc8eb3a0994ddfae953b9b3a3ceecf8a3110df2d91ff0e3dd11756aa3065a9fd9520d9ed3
|
7
|
+
data.tar.gz: e3783cc55413014249911495625eb5f01efef58a5fe3acd9991d0d1a10bad45448a03d63d74ef778819003ee703ddabc936910b71c43ced6d6596bf92db17cbf
|
@@ -0,0 +1,41 @@
|
|
1
|
+
name: RSpec
|
2
|
+
|
3
|
+
# Controls when the action will run. Triggers the workflow on push or pull request
|
4
|
+
# events but only for the master branch
|
5
|
+
on: [ push, pull_request ]
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
# This workflow contains a single job "rspec"
|
9
|
+
rspec:
|
10
|
+
# The type of runner that the job will run on
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
|
13
|
+
strategy:
|
14
|
+
matrix:
|
15
|
+
ruby_version: [ 2.6, 2.7, 3.0 ]
|
16
|
+
|
17
|
+
# Steps represent a sequence of tasks that will be executed as part of the job
|
18
|
+
steps:
|
19
|
+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
20
|
+
- uses: actions/checkout@v2
|
21
|
+
|
22
|
+
- name: Set up Ruby ${{ matrix.ruby_version }}
|
23
|
+
uses: ruby/setup-ruby@v1
|
24
|
+
with:
|
25
|
+
ruby-version: ${{ matrix.ruby_version }}
|
26
|
+
|
27
|
+
- name: Install gems
|
28
|
+
run: |
|
29
|
+
bundle config path vendor/bundle
|
30
|
+
bundle install --jobs 4 --retry 3
|
31
|
+
|
32
|
+
- name: Cache gems
|
33
|
+
uses: actions/cache@v1
|
34
|
+
with:
|
35
|
+
path: vendor/bundle
|
36
|
+
key: ${{ runner.os }}-${{ matrix.ruby_version }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
37
|
+
restore-keys: |
|
38
|
+
${{ runner.os }}-${{ matrix.ruby_version }}-gems-
|
39
|
+
|
40
|
+
- name: Run RSpec
|
41
|
+
run: bundle exec rspec
|
data/.rubocop.yml
CHANGED
@@ -2,31 +2,28 @@ AllCops:
|
|
2
2
|
DisplayCopNames: true
|
3
3
|
DisplayStyleGuide: true
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
Layout/AlignParameters:
|
6
|
+
EnforcedStyle: with_fixed_indentation
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
Metrics/LineLength:
|
9
|
+
Max: 90
|
10
10
|
|
11
|
-
|
11
|
+
Layout/MultilineMethodCallIndentation:
|
12
12
|
EnforcedStyle: indented
|
13
13
|
|
14
|
-
|
15
|
-
EnforcedStyle: with_fixed_indentation
|
16
|
-
|
17
|
-
Style/ClassAndModuleChildren:
|
18
|
-
Enabled: false
|
19
|
-
|
20
|
-
Style/SpaceBeforeFirstArg:
|
14
|
+
Layout/SpaceBeforeFirstArg:
|
21
15
|
Include:
|
22
16
|
- db/migrate/*.rb
|
23
17
|
Enabled: false
|
24
18
|
|
25
|
-
Style/
|
19
|
+
Style/Documentation:
|
26
20
|
Enabled: false
|
27
21
|
|
28
|
-
|
29
|
-
|
22
|
+
Style/ClassAndModuleChildren:
|
23
|
+
Enabled: true
|
24
|
+
|
25
|
+
Style/Lambda:
|
26
|
+
Enabled: false
|
30
27
|
|
31
28
|
Metrics/MethodLength:
|
32
29
|
Max: 15
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.3.1 (Aug 2nd, 2021)
|
4
|
+
- Corrected gem dependencies so it properly requires RSpec when loaded (thanks to @itay-grudev)
|
5
|
+
|
3
6
|
## 1.3.0 (May 7th, 2020)
|
4
7
|
|
5
8
|
- `accept_argument` matcher accepts underscored argument names and passes even if the actual argument is camel-cased (https://github.com/khamusa/rspec-graphql_matchers/pull/32 thanks to @TonyArra);
|
data/Gemfile
CHANGED
@@ -1,10 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
source 'https://rubygems.org'
|
2
4
|
|
3
5
|
# Specify your gem's dependencies in rspec-graphql_matchers.gemspec
|
4
6
|
gemspec
|
5
7
|
|
8
|
+
# rubocop:disable Bundle/DuplicatedGem
|
6
9
|
if ENV['GRAPHQL_GEM_VERSION'] == '1.8'
|
7
10
|
gem 'graphql', '~> 1.8.0'
|
8
11
|
elsif ENV['GRAPHQL_GEM_VERSION'] == '1.9'
|
9
12
|
gem 'graphql', '~> 1.9.0'
|
10
13
|
end
|
14
|
+
# rubocop:enable Bundle/DuplicatedGem
|
data/README.md
CHANGED
data/Rakefile
CHANGED
data/bin/console
CHANGED
@@ -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
|
|
@@ -29,8 +31,8 @@ module RSpec
|
|
29
31
|
@actual_argument ||= field_arguments[@expected_camel_arg_name]
|
30
32
|
return false if @actual_argument.nil?
|
31
33
|
|
32
|
-
@results = @expectations.
|
33
|
-
|
34
|
+
@results = @expectations.reject do |matcher|
|
35
|
+
matcher.matches?(@actual_argument)
|
34
36
|
end
|
35
37
|
|
36
38
|
@results.empty?
|
@@ -1,10 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'base_matcher'
|
2
4
|
|
3
5
|
module RSpec
|
4
6
|
module GraphqlMatchers
|
5
7
|
class Implement < BaseMatcher
|
6
8
|
def initialize(interfaces)
|
7
|
-
@expected = interfaces.map {|interface| interface_name(interface) }
|
9
|
+
@expected = interfaces.map { |interface| interface_name(interface) }
|
8
10
|
end
|
9
11
|
|
10
12
|
def matches?(graph_object)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rspec/matchers'
|
2
4
|
require 'rspec/graphql_matchers/be_of_type'
|
3
5
|
require 'rspec/graphql_matchers/accept_arguments'
|
@@ -13,13 +15,13 @@ module RSpec
|
|
13
15
|
|
14
16
|
def accept_argument(expected_argument)
|
15
17
|
RSpec::GraphqlMatchers::AcceptArgument.new(expected_argument)
|
16
|
-
|
18
|
+
end
|
17
19
|
|
18
20
|
def accept_arguments(expected_args)
|
19
21
|
RSpec::GraphqlMatchers::AcceptArguments.new(expected_args)
|
20
22
|
end
|
21
23
|
|
22
|
-
# rubocop:disable
|
24
|
+
# rubocop:disable Naming/PredicateName
|
23
25
|
def have_a_field(field_name)
|
24
26
|
RSpec::GraphqlMatchers::HaveAField.new(field_name)
|
25
27
|
end
|
@@ -34,6 +36,7 @@ module RSpec
|
|
34
36
|
RSpec::GraphqlMatchers::HaveAField.new(field_name, :return_fields)
|
35
37
|
end
|
36
38
|
alias have_return_field have_a_return_field
|
39
|
+
# rubocop:enable Naming/PredicateName
|
37
40
|
|
38
41
|
def implement(*interface_names)
|
39
42
|
RSpec::GraphqlMatchers::Implement.new(interface_names.flatten)
|
@@ -25,9 +25,11 @@ 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.
|
28
|
+
spec.add_dependency 'graphql', '>= 1.8', '< 2.0'
|
29
|
+
spec.add_dependency 'rspec', '~> 3.0'
|
29
30
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
30
|
-
|
31
|
-
spec.add_development_dependency '
|
31
|
+
# CodeClimate does not yet support SimpleCov 0.18
|
32
|
+
spec.add_development_dependency 'simplecov', '~>0.17.0'
|
32
33
|
spec.add_development_dependency 'pry', '~> 0'
|
34
|
+
spec.add_development_dependency 'rubocop', '0.71'
|
33
35
|
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.3.
|
4
|
+
version: 1.3.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:
|
11
|
+
date: 2021-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|
@@ -31,47 +31,47 @@ dependencies:
|
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '2.0'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
|
-
name:
|
34
|
+
name: rspec
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
40
|
-
type: :
|
39
|
+
version: '3.0'
|
40
|
+
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
46
|
+
version: '3.0'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
48
|
+
name: bundler
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- -
|
51
|
+
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '0
|
53
|
+
version: '2.0'
|
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: '2.0'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
|
-
name:
|
62
|
+
name: simplecov
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version:
|
67
|
+
version: 0.17.0
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
74
|
+
version: 0.17.0
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: pry
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,6 +86,20 @@ dependencies:
|
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '0'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: rubocop
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - '='
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0.71'
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - '='
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0.71'
|
89
103
|
description:
|
90
104
|
email:
|
91
105
|
- gb.samuel@gmail.com
|
@@ -95,10 +109,10 @@ extra_rdoc_files: []
|
|
95
109
|
files:
|
96
110
|
- ".codeclimate.yml"
|
97
111
|
- ".editorconfig"
|
112
|
+
- ".github/workflows/rspec.yml"
|
98
113
|
- ".gitignore"
|
99
114
|
- ".rspec"
|
100
115
|
- ".rubocop.yml"
|
101
|
-
- ".travis.yml"
|
102
116
|
- CHANGELOG.md
|
103
117
|
- CODE_OF_CONDUCT.md
|
104
118
|
- Gemfile
|
@@ -142,8 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
142
156
|
- !ruby/object:Gem::Version
|
143
157
|
version: '0'
|
144
158
|
requirements: []
|
145
|
-
|
146
|
-
rubygems_version: 2.7.10
|
159
|
+
rubygems_version: 3.2.5
|
147
160
|
signing_key:
|
148
161
|
specification_version: 4
|
149
162
|
summary: Collection of rspec matchers to test your graphQL api schema.
|
data/.travis.yml
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
sudo: false
|
2
|
-
language: ruby
|
3
|
-
rvm:
|
4
|
-
- 2.3.1
|
5
|
-
before_install: gem install bundler -v 1.12.3
|
6
|
-
script: bundle exec rspec
|
7
|
-
matrix:
|
8
|
-
include:
|
9
|
-
- name: "GraphQL 1.9.x"
|
10
|
-
env: GRAPHQL_GEM_VERSION=1.9
|
11
|
-
- name: "GraphQL 1.8.x"
|
12
|
-
env: GRAPHQL_GEM_VERSION=1.8
|