key_vortex-contract 0.2.5 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +11 -4
- data/lib/key_vortex/contract/version.rb +17 -1
- data/lib/key_vortex/contract.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1469f469f1d5844fd358ee02cf0170adcb2524a205df9ceacc37ada6ca96ef36
|
4
|
+
data.tar.gz: ca7dc3ebbc34889aef1ff62bd4a9a441da4a7de58c3312a9f0ec8eb6e3fbde72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7cf2d061a0301a195b194f0ecfdd1c41740d4faf7ccf676980b3bed7f8f30e61e8dd84881847490ea5cc6bab18bf02c48da2263e3f131da43778a291605d0e2
|
7
|
+
data.tar.gz: d6fe973d5d2bce29034b88e142c1e7fd609b1f93ada2ec62d751a0ae07e9e827583f2b11c48bc526c6e41f8de4f1bdd3a45317c2ff2dc04299341c1aec7a1b67
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# KeyVortex::Contract
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
Adapters built for [KeyVortex](https://github.com/lambda-Null/key-vortex/) must conform to a common set of behaviors in order to play nicely together. This gem provides [shared examples](https://rubydoc.info/gems/key_vortex-contract/KeyVortex/Contract) that can be included in your tests to verify that you support these behaviors.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -22,7 +20,16 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
23
|
+
Within the RSpec tests for your adapter subclass, you can include the contract like this:
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
require "key_vortex/constract"
|
27
|
+
|
28
|
+
RSpec.describe KeyVortex::Adapter::SomethingAwesome do
|
29
|
+
subject { KeyVortex::Adapter::SomethingAwesome.new() }
|
30
|
+
it_behaves_like "an adapter"
|
31
|
+
end
|
32
|
+
```
|
26
33
|
|
27
34
|
## Development
|
28
35
|
|
@@ -1,7 +1,23 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module KeyVortex
|
4
|
+
# NOTE: yard isn't going to document a shared example, so adding it here.
|
5
|
+
|
6
|
+
# KeyVortex will assume that adapters behave in certain ways, which
|
7
|
+
# are documented here. You can also include shared examples provided
|
8
|
+
# by this gem to ensure that it conforms to those behaviors.
|
9
|
+
#
|
10
|
+
# In order to use KeyVortex.vortex, it must register the class by
|
11
|
+
# calling KeyVortex.register.
|
12
|
+
#
|
13
|
+
# If #save is called, #find must be able to retrieve the record
|
14
|
+
# using the #key afterwards.
|
15
|
+
#
|
16
|
+
# If #remove is called, #find must return nil on the key afterward.
|
17
|
+
#
|
18
|
+
# if #save is called on a record, subsequent calls to #find must
|
19
|
+
# return the same class that was saved.
|
4
20
|
module Contract
|
5
|
-
VERSION = "0.
|
21
|
+
VERSION = "1.0.0"
|
6
22
|
end
|
7
23
|
end
|
data/lib/key_vortex/contract.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: key_vortex-contract
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lambda Null
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
11
|
+
date: 2023-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rantly
|