key_vortex-contract 0.2.5 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3cb2953b918193e1e011d64dc301c1abe6c1e114b8c49e4a198ff1d435786ff2
4
- data.tar.gz: 065411af7e6a7f429073e0938bddc25f5205753796a0e71b4a808744b121f37b
3
+ metadata.gz: 1469f469f1d5844fd358ee02cf0170adcb2524a205df9ceacc37ada6ca96ef36
4
+ data.tar.gz: ca7dc3ebbc34889aef1ff62bd4a9a441da4a7de58c3312a9f0ec8eb6e3fbde72
5
5
  SHA512:
6
- metadata.gz: 5c8cb9f799ad3fb2129a74d434a28e3d52ce32a223f6ed7a6c64f758935d7d1ff5e8e0de3a6969e283c0989d766d7bceb66b6dde602f19769dba124dd542ab1a
7
- data.tar.gz: 9642cb39fbd27b5d57ef118082a813ef9b8fdff474fedd061634f0c4bdb924a280e28dc7498062696bb10bdb42f2439ebef6972782d93642e0b0edb1a3e6fab6
6
+ metadata.gz: e7cf2d061a0301a195b194f0ecfdd1c41740d4faf7ccf676980b3bed7f8f30e61e8dd84881847490ea5cc6bab18bf02c48da2263e3f131da43778a291605d0e2
7
+ data.tar.gz: d6fe973d5d2bce29034b88e142c1e7fd609b1f93ada2ec62d751a0ae07e9e827583f2b11c48bc526c6e41f8de4f1bdd3a45317c2ff2dc04299341c1aec7a1b67
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- key_vortex-contract (0.2.5)
4
+ key_vortex-contract (1.0.0)
5
5
  rantly (~> 2.0.0)
6
6
  rspec (~> 3.0)
7
7
 
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # KeyVortex::Contract
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/key_vortex/contract`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Write usage instructions here
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.2.5"
21
+ VERSION = "1.0.0"
6
22
  end
7
23
  end
@@ -13,7 +13,7 @@ end
13
13
 
14
14
  require "rantly/rspec_extensions"
15
15
 
16
- RSpec.shared_context "an adapter" do |build_args = {}|
16
+ RSpec.shared_examples "an adapter" do |build_args = {}|
17
17
  around(:each) do |s|
18
18
  property_of { string }.check(100) do |sample|
19
19
  @sample = sample
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.2.5
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-14 00:00:00.000000000 Z
11
+ date: 2023-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rantly