spyke 6.1.2 → 6.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +24 -0
- data/README.md +4 -6
- data/lib/spyke/http.rb +3 -3
- data/lib/spyke/scope_registry.rb +15 -4
- data/lib/spyke/version.rb +1 -1
- data/spyke.gemspec +2 -1
- data/spyke.svg +22 -0
- data/test/activemodel_dirty_test.rb +1 -1
- data/test/attributes_test.rb +7 -2
- data/test/custom_request_test.rb +1 -1
- data/test/fallbacks_test.rb +6 -0
- data/test/scope_registry_test.rb +11 -0
- data/test/test_helper.rb +7 -4
- metadata +31 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ba8000e29f83abe34550b8453ff430358759237765158641544c2deabe24014
|
4
|
+
data.tar.gz: 81d4521b0f2a0c22647c5ee4e8fb2d191eab09bf3eda9c114e8aef52ecfdbf80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 834dbdbcf76ae84d9e7b037ac798385a9d911ad2089c7b4b34a40eea82fcdabcf0e8c8aa0fa751a27d38ad8f13f1dbbf833a1b40b0fb741ff9ce631e7ed0982e
|
7
|
+
data.tar.gz: 70fe2847b7971c9479490d26adfdf05ea9f9f065be171281fce3a0b536b440d506feede266bb05943796aa81568ae32045d4bd9a202609633233564a78eeefa1
|
data/.circleci/config.yml
CHANGED
@@ -6,6 +6,8 @@ version: 2.1
|
|
6
6
|
# See: https://circleci.com/docs/2.0/orb-intro/
|
7
7
|
orbs:
|
8
8
|
ruby: circleci/ruby@0.1.2
|
9
|
+
coveralls: coveralls/coveralls@1.0.6
|
10
|
+
node: circleci/node@5.0.0
|
9
11
|
|
10
12
|
# Define a job to be invoked later in a workflow.
|
11
13
|
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
|
@@ -21,6 +23,7 @@ jobs:
|
|
21
23
|
executor: ruby/default
|
22
24
|
environment:
|
23
25
|
RAILS_TEST_VERSION: << parameters.rails_version >>
|
26
|
+
EUID: 0 # not sure why this is needed, but sudo npm fails
|
24
27
|
steps:
|
25
28
|
- checkout
|
26
29
|
- run:
|
@@ -33,22 +36,43 @@ jobs:
|
|
33
36
|
- run:
|
34
37
|
name: Run tests
|
35
38
|
command: bundle exec rake
|
39
|
+
- node/install:
|
40
|
+
node-version: 10.0.0
|
41
|
+
- coveralls/upload:
|
42
|
+
parallel: true
|
43
|
+
coverage:
|
44
|
+
docker:
|
45
|
+
- image: circleci/node:10.0.0
|
46
|
+
steps:
|
47
|
+
- coveralls/upload:
|
48
|
+
parallel_finished: true
|
36
49
|
|
37
50
|
workflows:
|
38
51
|
tests:
|
39
52
|
jobs:
|
40
53
|
- build:
|
41
54
|
matrix:
|
55
|
+
alias: Rails 4
|
56
|
+
parameters:
|
57
|
+
rails_version: ["~> 4.0"]
|
58
|
+
ruby_version: ["2.6.6"]
|
59
|
+
- build:
|
60
|
+
matrix:
|
61
|
+
alias: Rails 5
|
42
62
|
parameters:
|
43
63
|
rails_version: ["~> 5.0"]
|
44
64
|
ruby_version: ["2.6.6", "2.7.2"]
|
45
65
|
- build:
|
46
66
|
matrix:
|
67
|
+
alias: Rails 6
|
47
68
|
parameters:
|
48
69
|
rails_version: ["~> 6.0"]
|
49
70
|
ruby_version: ["2.6.6", "2.7.2", "3.0.0"]
|
50
71
|
- build:
|
51
72
|
matrix:
|
73
|
+
alias: Rails 7
|
52
74
|
parameters:
|
53
75
|
rails_version: ["~> 7.0"]
|
54
76
|
ruby_version: ["2.7.2", "3.0.0"]
|
77
|
+
- coverage:
|
78
|
+
requires: ["Rails 4", "Rails 5", "Rails 6", "Rails 7"]
|
data/README.md
CHANGED
@@ -1,15 +1,13 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
<p align="center">
|
4
|
-
<img src="http://upload.wikimedia.org/wikipedia/en/thumb/2/21/Spyke.jpg/392px-Spyke.jpg" width="15%" />
|
1
|
+
<div align="center">
|
2
|
+
<img src="spyke.svg" width="250" alt="Spyke" />
|
5
3
|
<br/>
|
6
4
|
Interact with remote <strong>REST services</strong> in an <strong>ActiveRecord-like</strong> manner.
|
7
5
|
<br /><br />
|
8
6
|
<a href="https://rubygems.org/gems/spyke"><img src="https://badge.fury.io/rb/spyke.svg?style=flat" alt="Gem Version"></a>
|
9
7
|
<a href="https://codeclimate.com/github/balvig/spyke"><img src="https://codeclimate.com/github/balvig/spyke/badges/gpa.svg" /></a>
|
10
8
|
<a href='https://coveralls.io/github/balvig/spyke'><img src="https://coveralls.io/repos/github/balvig/spyke/badge.svg" /></a>
|
11
|
-
<a href="https://circleci.com/gh/balvig/spyke"><img src="https://circleci.com/gh/balvig/spyke.svg?style=shield" /></a>
|
12
|
-
</
|
9
|
+
<a href="https://circleci.com/gh/balvig/spyke"><img src="https://circleci.com/gh/balvig/spyke.svg?style=shield" /></a>
|
10
|
+
</div>
|
13
11
|
|
14
12
|
---
|
15
13
|
|
data/lib/spyke/http.rb
CHANGED
@@ -114,10 +114,10 @@ module Spyke
|
|
114
114
|
field_errors.each do |error_attributes|
|
115
115
|
error = NormalizedValidationError.new(error_attributes)
|
116
116
|
|
117
|
-
if
|
118
|
-
errors.add(field.to_sym, error.message, **error.options)
|
119
|
-
else
|
117
|
+
if ActiveSupport::VERSION::MAJOR < 5
|
120
118
|
errors.add(field.to_sym, error.message, error.options)
|
119
|
+
else
|
120
|
+
errors.add(field.to_sym, error.message, **error.options)
|
121
121
|
end
|
122
122
|
end
|
123
123
|
end
|
data/lib/spyke/scope_registry.rb
CHANGED
@@ -1,17 +1,28 @@
|
|
1
1
|
module Spyke
|
2
2
|
class ScopeRegistry
|
3
|
-
|
3
|
+
# https://github.com/balvig/spyke/pull/128
|
4
|
+
if ActiveSupport::VERSION::MAJOR >= 7
|
5
|
+
class << self
|
6
|
+
delegate :value_for, :set_value_for, to: :new
|
7
|
+
end
|
8
|
+
|
9
|
+
thread_mattr_accessor :registry
|
10
|
+
else
|
11
|
+
extend ActiveSupport::PerThreadRegistry
|
12
|
+
|
13
|
+
attr_accessor :registry
|
14
|
+
end
|
4
15
|
|
5
16
|
def initialize
|
6
|
-
|
17
|
+
self.registry ||= Hash.new { |hash, key| hash[key] = {} }
|
7
18
|
end
|
8
19
|
|
9
20
|
def value_for(scope_type, variable_name)
|
10
|
-
|
21
|
+
registry[scope_type][variable_name]
|
11
22
|
end
|
12
23
|
|
13
24
|
def set_value_for(scope_type, variable_name, value)
|
14
|
-
|
25
|
+
registry[scope_type][variable_name] = value
|
15
26
|
end
|
16
27
|
end
|
17
28
|
end
|
data/lib/spyke/version.rb
CHANGED
data/spyke.gemspec
CHANGED
@@ -26,7 +26,6 @@ Gem::Specification.new do |spec|
|
|
26
26
|
|
27
27
|
spec.add_development_dependency 'actionpack', ENV.fetch('RAILS_TEST_VERSION', '>= 4.0.0')
|
28
28
|
spec.add_development_dependency 'bundler', '>= 1.6'
|
29
|
-
spec.add_development_dependency 'coveralls_reborn', '~> 0.23.0'
|
30
29
|
spec.add_development_dependency 'minitest'
|
31
30
|
spec.add_development_dependency 'minitest-line'
|
32
31
|
spec.add_development_dependency 'minitest-reporters'
|
@@ -34,5 +33,7 @@ Gem::Specification.new do |spec|
|
|
34
33
|
spec.add_development_dependency 'multi_json'
|
35
34
|
spec.add_development_dependency 'pry'
|
36
35
|
spec.add_development_dependency 'rake'
|
36
|
+
spec.add_development_dependency 'simplecov'
|
37
|
+
spec.add_development_dependency 'simplecov-lcov'
|
37
38
|
spec.add_development_dependency 'webmock'
|
38
39
|
end
|
data/spyke.svg
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="180" height="70" viewBox="0 0 180 70" xml:space="preserve">
|
4
|
+
<desc>Created with Fabric.js 4.6.0</desc>
|
5
|
+
<defs>
|
6
|
+
</defs>
|
7
|
+
<g transform="matrix(0.83 0 0 0.8 31.5 36)" id="6X9shhn5tjKNE9PTybgYf" >
|
8
|
+
<path style="stroke: rgb(252,0,51); stroke-width: 3; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-opacity: 0; fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(0, 0)" d="M -19.8939 12.44496 L 19.8939 -12.44496 L 19.8939 12.44496" stroke-linecap="round" />
|
9
|
+
</g>
|
10
|
+
<g transform="matrix(1 0 0 1 48 26)" id="qfktuO63U17zxOoFBmSIk" >
|
11
|
+
<path style="stroke: rgb(23,172,60); stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(252,0,51); fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-4, -4)" d="M 4 0 C 6.208 0 8 1.792 8 4 C 8 6.208 6.208 8 4 8 C 1.7919999999999998 8 0 6.208 0 4 C 0 1.7919999999999998 1.792 0 4 0 z" stroke-linecap="round" />
|
12
|
+
</g>
|
13
|
+
<g transform="matrix(1 0 0 1 48 45)" id="CoP4qh0-57aRlWWd5gWpq" >
|
14
|
+
<path style="stroke: rgb(23,172,60); stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(252,0,51); fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-4, -4)" d="M 4 0 C 6.208 0 8 1.792 8 4 C 8 6.208 6.208 8 4 8 C 1.7919999999999998 8 0 6.208 0 4 C 0 1.7919999999999998 1.792 0 4 0 z" stroke-linecap="round" />
|
15
|
+
</g>
|
16
|
+
<g transform="matrix(1 0 0 1 16 45)" id="0AYtWnywiPmVyWgmd3Nax" >
|
17
|
+
<path style="stroke: rgb(23,172,60); stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(252,0,51); fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-4, -4)" d="M 4 0 C 6.208 0 8 1.792 8 4 C 8 6.208 6.208 8 4 8 C 1.7919999999999998 8 0 6.208 0 4 C 0 1.7919999999999998 1.792 0 4 0 z" stroke-linecap="round" />
|
18
|
+
</g>
|
19
|
+
<g transform="matrix(1.01 0 0 1.02 111 35.5)" id="0CUp8y4TleogKJWzIB5ti" >
|
20
|
+
<path style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-115.71, -44.78)" d="M 72.39608287 59.952 L 72.39608287 59.952 Q 69.77208287 59.952 67.88608287 59.1525 Q 66.00008287 58.353 64.99558287 57.3075 Q 63.99108287 56.262 63.99108287 55.524 L 63.99108287 55.524 Q 63.99108287 55.196 64.17558287 54.827 Q 64.36008287 54.458 64.64708287 54.2325 Q 64.93408287 54.007 65.22108287 54.007 L 65.22108287 54.007 Q 65.63108287 54.007 66.06158287 54.5195 Q 66.49208287 55.032 67.20958287 55.7085 Q 67.92708287 56.385 69.11608287 56.8975 Q 70.30508287 57.41 72.23208287 57.41 L 72.23208287 57.41 Q 74.15908287 57.41 75.53258287 56.7745 Q 76.90608287 56.139 77.62358287 54.8885 Q 78.34108287 53.638 78.34108287 51.752 L 78.34108287 51.752 Q 78.34108287 49.784 77.60308287 48.5745 Q 76.86508287 47.365 75.65558287 46.6065 Q 74.44608287 45.848 73.01108287 45.2945 Q 71.57608287 44.741 70.12058287 44.1875 Q 68.66508287 43.634 67.45558287 42.7935 Q 66.24608287 41.953 65.48758287 40.5795 Q 64.72908287 39.206 64.72908287 37.074 L 64.72908287 37.074 Q 64.72908287 34.819 65.54908287 33.384 Q 66.36908287 31.949 67.66058287 31.129 Q 68.95208287 30.309 70.46908287 29.9605 Q 71.98608287 29.612 73.42108287 29.612 L 73.42108287 29.612 Q 74.56908287 29.612 75.77858287 29.7965 Q 76.98808287 29.981 78.01308287 30.309 Q 79.03808287 30.637 79.67358287 31.088 Q 80.30908287 31.539 80.30908287 32.113 L 80.30908287 32.113 Q 80.30908287 32.4 80.16558287 32.7485 Q 80.02208287 33.097 79.77608287 33.3635 Q 79.53008287 33.63 79.12008287 33.63 L 79.12008287 33.63 Q 78.75108287 33.63 78.09508287 33.2405 Q 77.43908287 32.851 76.31158287 32.4615 Q 75.18408287 32.072 73.38008287 32.072 L 73.38008287 32.072 Q 71.90408287 32.072 70.53058287 32.5025 Q 69.15708287 32.933 68.29608287 33.958 Q 67.43508287 34.983 67.43508287 36.828 L 67.43508287 36.828 Q 67.43508287 38.468 68.19358287 39.4725 Q 68.95208287 40.477 70.16158287 41.092 Q 71.37108287 41.707 72.80608287 42.2195 Q 74.24108287 42.732 75.69658287 43.3675 Q 77.15208287 44.003 78.36158287 44.9665 Q 79.57108287 45.93 80.30908287 47.488 Q 81.04708287 49.046 81.04708287 51.506 L 81.04708287 51.506 Q 81.04708287 54.417 79.94008287 56.2825 Q 78.83308287 58.148 76.88558287 59.05 Q 74.93808287 59.952 72.39608287 59.952 Z M 87.23808287 59.665 L 87.23808287 59.665 Q 86.70508287 59.665 86.29508287 59.3985 Q 85.88508287 59.132 85.88508287 58.599 L 85.88508287 58.599 L 85.88508287 30.678 Q 85.88508287 30.268 86.19258287 30.0015 Q 86.50008287 29.735 87.03308287 29.694 L 87.03308287 29.694 L 94.57708287 29.694 Q 96.95508287 29.694 98.88208287 30.555 Q 100.80908287 31.416 101.91608287 33.3225 Q 103.02308287 35.229 103.02308287 38.386 L 103.02308287 38.386 L 103.02308287 38.796 Q 103.02308287 41.994 101.89558287 43.9005 Q 100.76808287 45.807 98.82058287 46.668 Q 96.87308287 47.529 94.49508287 47.529 L 94.49508287 47.529 L 88.59108287 47.529 L 88.59108287 58.599 Q 88.59108287 59.132 88.16058287 59.3985 Q 87.73008287 59.665 87.23808287 59.665 Z M 88.59108287 32.195 L 88.59108287 45.192 L 94.49508287 45.192 Q 97.24208287 45.192 98.77958287 43.6545 Q 100.31708287 42.117 100.31708287 38.919 L 100.31708287 38.919 L 100.31708287 38.427 Q 100.31708287 35.229 98.77958287 33.712 Q 97.24208287 32.195 94.49508287 32.195 L 94.49508287 32.195 L 88.59108287 32.195 Z M 115.15908287 59.665 L 115.15908287 59.665 Q 114.66708287 59.665 114.23658287 59.3985 Q 113.80608287 59.132 113.80608287 58.599 L 113.80608287 58.599 L 113.80608287 48.185 Q 113.80608287 47.98 113.76508287 47.857 L 113.76508287 47.857 L 105.27808287 31.58 Q 105.15508287 31.334 105.11408287 31.1495 Q 105.07308287 30.965 105.07308287 30.842 L 105.07308287 30.842 Q 105.07308287 30.473 105.29858287 30.227 Q 105.52408287 29.981 105.87258287 29.8375 Q 106.22108287 29.694 106.54908287 29.694 L 106.54908287 29.694 Q 106.87708287 29.694 107.14358287 29.899 Q 107.41008287 30.104 107.61508287 30.514 L 107.61508287 30.514 L 115.15908287 45.479 L 122.74408287 30.514 Q 122.99008287 30.104 123.25658287 29.899 Q 123.52308287 29.694 123.81008287 29.694 L 123.81008287 29.694 Q 124.17908287 29.694 124.50708287 29.8375 Q 124.83508287 29.981 125.06058287 30.227 Q 125.28608287 30.473 125.28608287 30.842 L 125.28608287 30.842 Q 125.28608287 30.965 125.24508287 31.1495 Q 125.20408287 31.334 125.12208287 31.58 L 125.12208287 31.58 L 116.59408287 47.857 Q 116.51208287 47.98 116.51208287 48.185 L 116.51208287 48.185 L 116.51208287 58.599 Q 116.51208287 59.132 116.10208287 59.3985 Q 115.69208287 59.665 115.15908287 59.665 Z M 130.49308287 59.665 L 130.49308287 59.665 Q 129.96008287 59.665 129.55008287 59.3985 Q 129.14008287 59.132 129.14008287 58.599 L 129.14008287 58.599 L 129.14008287 30.678 Q 129.14008287 30.145 129.55008287 29.9195 Q 129.96008287 29.694 130.49308287 29.694 L 130.49308287 29.694 Q 130.98508287 29.694 131.41558287 29.9195 Q 131.84608287 30.145 131.84608287 30.678 L 131.84608287 30.678 L 131.84608287 45.192 L 143.69508287 30.104 Q 143.98208287 29.694 144.55608287 29.694 L 144.55608287 29.694 Q 144.88408287 29.694 145.23258287 29.899 Q 145.58108287 30.104 145.80658287 30.4115 Q 146.03208287 30.719 146.03208287 31.088 L 146.03208287 31.088 Q 146.03208287 31.211 145.99108287 31.3955 Q 145.95008287 31.58 145.82708287 31.703 L 145.82708287 31.703 L 137.01208287 42.65 L 147.09808287 57.82 Q 147.26208287 58.066 147.26208287 58.353 L 147.26208287 58.353 Q 147.26208287 58.722 147.03658287 59.0295 Q 146.81108287 59.337 146.46258287 59.5215 Q 146.11408287 59.706 145.70408287 59.706 L 145.70408287 59.706 Q 145.41708287 59.706 145.15058287 59.5625 Q 144.88408287 59.419 144.67908287 59.132 L 144.67908287 59.132 L 135.20808287 44.905 L 131.84608287 49.169 L 131.84608287 58.599 Q 131.84608287 59.132 131.41558287 59.3985 Q 130.98508287 59.665 130.49308287 59.665 Z M 166.40908287 59.665 L 151.81308287 59.665 Q 151.36208287 59.665 150.97258287 59.3985 Q 150.58308287 59.132 150.58308287 58.599 L 150.58308287 58.599 L 150.58308287 30.719 Q 150.58308287 30.227 150.97258287 29.9605 Q 151.36208287 29.694 151.81308287 29.694 L 151.81308287 29.694 L 166.40908287 29.694 Q 166.94208287 29.694 167.18808287 30.0835 Q 167.43408287 30.473 167.43408287 30.883 L 167.43408287 30.883 Q 167.43408287 31.416 167.16758287 31.8055 Q 166.90108287 32.195 166.40908287 32.195 L 166.40908287 32.195 L 153.28908287 32.195 L 153.28908287 43.47 L 159.72608287 43.47 Q 160.21808287 43.47 160.48458287 43.839 Q 160.75108287 44.208 160.75108287 44.7 L 160.75108287 44.7 Q 160.75108287 45.069 160.50508287 45.438 Q 160.25908287 45.807 159.72608287 45.807 L 159.72608287 45.807 L 153.28908287 45.807 L 153.28908287 57.164 L 166.40908287 57.164 Q 166.90108287 57.164 167.16758287 57.533 Q 167.43408287 57.902 167.43408287 58.435 L 167.43408287 58.435 Q 167.43408287 58.886 167.18808287 59.2755 Q 166.94208287 59.665 166.40908287 59.665 L 166.40908287 59.665 Z" stroke-linecap="round" />
|
21
|
+
</g>
|
22
|
+
</svg>
|
data/test/attributes_test.rb
CHANGED
@@ -18,8 +18,13 @@ module Spyke
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def test_initializing_using_unpermitted_strong_params
|
21
|
-
|
22
|
-
Ingredient.new(strong_params(name: 'Flour'))
|
21
|
+
if ActiveSupport::VERSION::MAJOR < 5
|
22
|
+
ingredient = Ingredient.new(strong_params(name: 'Flour'))
|
23
|
+
assert_equal({}, ingredient.attributes)
|
24
|
+
else
|
25
|
+
assert_raises ActionController::UnfilteredParameters do
|
26
|
+
Ingredient.new(strong_params(name: 'Flour'))
|
27
|
+
end
|
23
28
|
end
|
24
29
|
end
|
25
30
|
|
data/test/custom_request_test.rb
CHANGED
@@ -70,7 +70,7 @@ module Spyke
|
|
70
70
|
|
71
71
|
def test_multiple_apis_with_custom_fallback
|
72
72
|
fallback_endpoint = stub_request(:get, 'http://sushi.com/recipes')
|
73
|
-
|
73
|
+
_primary_endpoint = stub_request(:get, 'http://sashimi.com/recipes').to_timeout
|
74
74
|
OtherRecipe.all.to_a
|
75
75
|
assert_requested fallback_endpoint
|
76
76
|
end
|
data/test/fallbacks_test.rb
CHANGED
@@ -7,6 +7,12 @@ module Spyke
|
|
7
7
|
stub_request(:get, "http://sushi.com/recipes?published=true").to_timeout
|
8
8
|
end
|
9
9
|
|
10
|
+
def test_find_without_fallback
|
11
|
+
assert_raises ConnectionError do
|
12
|
+
Recipe.find(1)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
10
16
|
def test_find_with_default_fallback
|
11
17
|
assert_raises ResourceNotFound do
|
12
18
|
Recipe.with_fallback.find(1)
|
data/test/test_helper.rb
CHANGED
@@ -1,7 +1,10 @@
|
|
1
|
-
|
2
|
-
require '
|
3
|
-
|
4
|
-
|
1
|
+
require 'simplecov'
|
2
|
+
require 'simplecov-lcov'
|
3
|
+
SimpleCov::Formatter::LcovFormatter.config do |c|
|
4
|
+
c.report_with_single_file = true
|
5
|
+
c.single_report_path = 'coverage/lcov.info'
|
6
|
+
end
|
7
|
+
SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter
|
5
8
|
SimpleCov.start do
|
6
9
|
add_filter 'test'
|
7
10
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spyke
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.1.
|
4
|
+
version: 6.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Balvig
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -121,21 +121,21 @@ dependencies:
|
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: '1.6'
|
123
123
|
- !ruby/object:Gem::Dependency
|
124
|
-
name:
|
124
|
+
name: minitest
|
125
125
|
requirement: !ruby/object:Gem::Requirement
|
126
126
|
requirements:
|
127
|
-
- - "
|
127
|
+
- - ">="
|
128
128
|
- !ruby/object:Gem::Version
|
129
|
-
version: 0
|
129
|
+
version: '0'
|
130
130
|
type: :development
|
131
131
|
prerelease: false
|
132
132
|
version_requirements: !ruby/object:Gem::Requirement
|
133
133
|
requirements:
|
134
|
-
- - "
|
134
|
+
- - ">="
|
135
135
|
- !ruby/object:Gem::Version
|
136
|
-
version: 0
|
136
|
+
version: '0'
|
137
137
|
- !ruby/object:Gem::Dependency
|
138
|
-
name: minitest
|
138
|
+
name: minitest-line
|
139
139
|
requirement: !ruby/object:Gem::Requirement
|
140
140
|
requirements:
|
141
141
|
- - ">="
|
@@ -149,7 +149,7 @@ dependencies:
|
|
149
149
|
- !ruby/object:Gem::Version
|
150
150
|
version: '0'
|
151
151
|
- !ruby/object:Gem::Dependency
|
152
|
-
name: minitest-
|
152
|
+
name: minitest-reporters
|
153
153
|
requirement: !ruby/object:Gem::Requirement
|
154
154
|
requirements:
|
155
155
|
- - ">="
|
@@ -163,7 +163,7 @@ dependencies:
|
|
163
163
|
- !ruby/object:Gem::Version
|
164
164
|
version: '0'
|
165
165
|
- !ruby/object:Gem::Dependency
|
166
|
-
name:
|
166
|
+
name: mocha
|
167
167
|
requirement: !ruby/object:Gem::Requirement
|
168
168
|
requirements:
|
169
169
|
- - ">="
|
@@ -177,7 +177,7 @@ dependencies:
|
|
177
177
|
- !ruby/object:Gem::Version
|
178
178
|
version: '0'
|
179
179
|
- !ruby/object:Gem::Dependency
|
180
|
-
name:
|
180
|
+
name: multi_json
|
181
181
|
requirement: !ruby/object:Gem::Requirement
|
182
182
|
requirements:
|
183
183
|
- - ">="
|
@@ -191,7 +191,7 @@ dependencies:
|
|
191
191
|
- !ruby/object:Gem::Version
|
192
192
|
version: '0'
|
193
193
|
- !ruby/object:Gem::Dependency
|
194
|
-
name:
|
194
|
+
name: pry
|
195
195
|
requirement: !ruby/object:Gem::Requirement
|
196
196
|
requirements:
|
197
197
|
- - ">="
|
@@ -205,7 +205,7 @@ dependencies:
|
|
205
205
|
- !ruby/object:Gem::Version
|
206
206
|
version: '0'
|
207
207
|
- !ruby/object:Gem::Dependency
|
208
|
-
name:
|
208
|
+
name: rake
|
209
209
|
requirement: !ruby/object:Gem::Requirement
|
210
210
|
requirements:
|
211
211
|
- - ">="
|
@@ -219,7 +219,21 @@ dependencies:
|
|
219
219
|
- !ruby/object:Gem::Version
|
220
220
|
version: '0'
|
221
221
|
- !ruby/object:Gem::Dependency
|
222
|
-
name:
|
222
|
+
name: simplecov
|
223
|
+
requirement: !ruby/object:Gem::Requirement
|
224
|
+
requirements:
|
225
|
+
- - ">="
|
226
|
+
- !ruby/object:Gem::Version
|
227
|
+
version: '0'
|
228
|
+
type: :development
|
229
|
+
prerelease: false
|
230
|
+
version_requirements: !ruby/object:Gem::Requirement
|
231
|
+
requirements:
|
232
|
+
- - ">="
|
233
|
+
- !ruby/object:Gem::Version
|
234
|
+
version: '0'
|
235
|
+
- !ruby/object:Gem::Dependency
|
236
|
+
name: simplecov-lcov
|
223
237
|
requirement: !ruby/object:Gem::Requirement
|
224
238
|
requirements:
|
225
239
|
- - ">="
|
@@ -288,6 +302,7 @@ files:
|
|
288
302
|
- lib/spyke/scoping.rb
|
289
303
|
- lib/spyke/version.rb
|
290
304
|
- spyke.gemspec
|
305
|
+
- spyke.svg
|
291
306
|
- test/activemodel_dirty_test.rb
|
292
307
|
- test/associations_test.rb
|
293
308
|
- test/attributes_test.rb
|
@@ -297,6 +312,7 @@ files:
|
|
297
312
|
- test/fallbacks_test.rb
|
298
313
|
- test/orm_test.rb
|
299
314
|
- test/path_test.rb
|
315
|
+
- test/scope_registry_test.rb
|
300
316
|
- test/scopes_test.rb
|
301
317
|
- test/support/fixtures.rb
|
302
318
|
- test/support/webmock.rb
|
@@ -334,6 +350,7 @@ test_files:
|
|
334
350
|
- test/fallbacks_test.rb
|
335
351
|
- test/orm_test.rb
|
336
352
|
- test/path_test.rb
|
353
|
+
- test/scope_registry_test.rb
|
337
354
|
- test/scopes_test.rb
|
338
355
|
- test/support/fixtures.rb
|
339
356
|
- test/support/webmock.rb
|