key_vortex-contract 0.2.4 → 1.0.0

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: 543e93a3027dedfe80e8907b3532016d59d654cc9a0c88997b12229e5271c092
4
- data.tar.gz: 0f37a24926f35974aa1c7f29e760abf1325f25c30a9379aa67a056d2134fd35d
3
+ metadata.gz: 1469f469f1d5844fd358ee02cf0170adcb2524a205df9ceacc37ada6ca96ef36
4
+ data.tar.gz: ca7dc3ebbc34889aef1ff62bd4a9a441da4a7de58c3312a9f0ec8eb6e3fbde72
5
5
  SHA512:
6
- metadata.gz: 8f3ef0ca6c385fc527bba5215b4ff78a1dc29be0534d214b3596589f591e9180d4bddc30f86acd77d2f5f506bd96a874c85efbe623fbd8a126e43b2c531e78c5
7
- data.tar.gz: 98cdf06193c38aef67c602a218d7bec104c2823d6f37cb37ce99825086d7047b9cb8f04ec0fc29984fa913f2b5c268a76bed27b9b7b55cc1ab0ba98cf6fb27f9
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.4)
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.4"
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.4
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