key_vortex-contract 0.2.0 → 0.2.1.1
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 +4 -4
- data/.rubocop.yml +5 -0
- data/Gemfile.lock +60 -0
- data/key_vortex-contract.gemspec +6 -3
- data/lib/key_vortex/contract/version.rb +1 -1
- data/lib/key_vortex/contract.rb +33 -6
- metadata +33 -4
- data/.rspec +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f685fa1ebff6a12fea1868fe808302f2db70d43cf09b13b32aa485855f81ec00
|
4
|
+
data.tar.gz: 93755b9effff1fd1d15b05cd817cbb756a5f6e2a2c67e7e839f5fdfe6d343478
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48b9c38b27e053c2e96a928febc2456b372f5062ef01fb57d22380cbe9a5a31e02e1d4993786e65bb92d960c5bd47a9aa395cb930814d33aa8f18ae2511051d1
|
7
|
+
data.tar.gz: efd7dcc22f13f506667967deddcdba8ff280cd6619c9b1cee1139ff515076c1f081e19c117e50cb5b19e18d659c0da22ba3e5805fc29d1093ca8768dde3bfc86
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
key_vortex-contract (0.2.1.1)
|
5
|
+
rantly (~> 2.0.0)
|
6
|
+
rspec (~> 3.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
ast (2.4.2)
|
12
|
+
diff-lcs (1.5.0)
|
13
|
+
json (2.6.3)
|
14
|
+
parallel (1.22.1)
|
15
|
+
parser (3.2.2.0)
|
16
|
+
ast (~> 2.4.1)
|
17
|
+
rainbow (3.1.1)
|
18
|
+
rake (13.0.6)
|
19
|
+
rantly (2.0.0)
|
20
|
+
regexp_parser (2.7.0)
|
21
|
+
rexml (3.2.5)
|
22
|
+
rspec (3.12.0)
|
23
|
+
rspec-core (~> 3.12.0)
|
24
|
+
rspec-expectations (~> 3.12.0)
|
25
|
+
rspec-mocks (~> 3.12.0)
|
26
|
+
rspec-core (3.12.1)
|
27
|
+
rspec-support (~> 3.12.0)
|
28
|
+
rspec-expectations (3.12.2)
|
29
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
30
|
+
rspec-support (~> 3.12.0)
|
31
|
+
rspec-mocks (3.12.5)
|
32
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
33
|
+
rspec-support (~> 3.12.0)
|
34
|
+
rspec-support (3.12.0)
|
35
|
+
rubocop (1.49.0)
|
36
|
+
json (~> 2.3)
|
37
|
+
parallel (~> 1.10)
|
38
|
+
parser (>= 3.2.0.0)
|
39
|
+
rainbow (>= 2.2.2, < 4.0)
|
40
|
+
regexp_parser (>= 1.8, < 3.0)
|
41
|
+
rexml (>= 3.2.5, < 4.0)
|
42
|
+
rubocop-ast (>= 1.28.0, < 2.0)
|
43
|
+
ruby-progressbar (~> 1.7)
|
44
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
45
|
+
rubocop-ast (1.28.0)
|
46
|
+
parser (>= 3.2.1.0)
|
47
|
+
ruby-progressbar (1.13.0)
|
48
|
+
unicode-display_width (2.4.2)
|
49
|
+
|
50
|
+
PLATFORMS
|
51
|
+
x86_64-linux
|
52
|
+
|
53
|
+
DEPENDENCIES
|
54
|
+
key_vortex-contract!
|
55
|
+
rake (~> 13.0)
|
56
|
+
rspec (~> 3.0)
|
57
|
+
rubocop (~> 1.21)
|
58
|
+
|
59
|
+
BUNDLED WITH
|
60
|
+
2.2.33
|
data/key_vortex-contract.gemspec
CHANGED
@@ -9,7 +9,9 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.email = ["lambda.null.42@gmail.com"]
|
10
10
|
|
11
11
|
spec.summary = "Provide a contract that KeyVortex adapters must conform"
|
12
|
-
spec.description = "Provides a portable suite of tests that can be dropped
|
12
|
+
spec.description = "Provides a portable suite of tests that can be dropped " \
|
13
|
+
"into any KeyVortex implementation so that functionality " \
|
14
|
+
"built on top of them can make certain assumptions"
|
13
15
|
spec.homepage = "https://github.com/Lambda-Null/key_vortex-contract"
|
14
16
|
spec.license = "MIT"
|
15
17
|
spec.required_ruby_version = ">= 2.6.0"
|
@@ -28,9 +30,10 @@ Gem::Specification.new do |spec|
|
|
28
30
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
29
31
|
spec.require_paths = ["lib"]
|
30
32
|
|
31
|
-
|
32
|
-
|
33
|
+
spec.add_dependency "rspec", "~> 3.0"
|
34
|
+
spec.add_dependency "rantly", "~> 2.0.0"
|
33
35
|
|
34
36
|
# For more information and examples about making a new gem, checkout our
|
35
37
|
# guide at: https://bundler.io/guides/creating_gem.html
|
38
|
+
spec.metadata["rubygems_mfa_required"] = "true"
|
36
39
|
end
|
data/lib/key_vortex/contract.rb
CHANGED
@@ -7,7 +7,20 @@ class SampleRecord < KeyVortex::Record
|
|
7
7
|
field :sample, String, length: 10
|
8
8
|
end
|
9
9
|
|
10
|
+
class SampleRecordTwo < KeyVortex::Record
|
11
|
+
field :sample, String, length: 10
|
12
|
+
end
|
13
|
+
|
14
|
+
require "rantly/rspec_extensions"
|
15
|
+
|
10
16
|
RSpec.shared_context "an adapter" do
|
17
|
+
around(:each) do |s|
|
18
|
+
property_of { string }.check(100) do |sample|
|
19
|
+
@sample = sample
|
20
|
+
s.run
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
11
24
|
let(:store) do
|
12
25
|
KeyVortex.new(
|
13
26
|
subject,
|
@@ -15,17 +28,31 @@ RSpec.shared_context "an adapter" do
|
|
15
28
|
)
|
16
29
|
end
|
17
30
|
|
18
|
-
let(:
|
31
|
+
let(:record1) do
|
19
32
|
SampleRecord.new(
|
20
33
|
key: SecureRandom.uuid,
|
21
|
-
sample:
|
34
|
+
sample: @sample
|
35
|
+
)
|
36
|
+
end
|
37
|
+
|
38
|
+
let(:record2) do
|
39
|
+
SampleRecordTwo.new(
|
40
|
+
key: SecureRandom.uuid,
|
41
|
+
sample: @sample
|
22
42
|
)
|
23
43
|
end
|
24
44
|
|
25
45
|
it "stores and removes a key" do
|
26
|
-
store.save(
|
27
|
-
expect(store.find(
|
28
|
-
subject.remove(
|
29
|
-
expect(store.find(
|
46
|
+
store.save(record1)
|
47
|
+
expect(store.find(record1.key)).to eq(record1)
|
48
|
+
subject.remove(record1.key)
|
49
|
+
expect(store.find(record1.key)).to be_nil
|
50
|
+
end
|
51
|
+
|
52
|
+
it "recreates the class that was provided" do
|
53
|
+
store.save(record1.key)
|
54
|
+
expect(store.find(record1.key)).to be_a(SampleRecord)
|
55
|
+
store.save(record2)
|
56
|
+
expect(store.find(record2.key)).to be_a(SampleRecordTwo)
|
30
57
|
end
|
31
58
|
end
|
metadata
CHANGED
@@ -1,15 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: key_vortex-contract
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1.1
|
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-
|
12
|
-
dependencies:
|
11
|
+
date: 2023-07-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rantly
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.0.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 2.0.0
|
13
41
|
description: Provides a portable suite of tests that can be dropped into any KeyVortex
|
14
42
|
implementation so that functionality built on top of them can make certain assumptions
|
15
43
|
email:
|
@@ -18,10 +46,10 @@ executables: []
|
|
18
46
|
extensions: []
|
19
47
|
extra_rdoc_files: []
|
20
48
|
files:
|
21
|
-
- ".rspec"
|
22
49
|
- ".rubocop.yml"
|
23
50
|
- CODE_OF_CONDUCT.md
|
24
51
|
- Gemfile
|
52
|
+
- Gemfile.lock
|
25
53
|
- LICENSE.txt
|
26
54
|
- README.md
|
27
55
|
- Rakefile
|
@@ -37,6 +65,7 @@ licenses:
|
|
37
65
|
metadata:
|
38
66
|
homepage_uri: https://github.com/Lambda-Null/key_vortex-contract
|
39
67
|
source_code_uri: https://github.com/Lambda-Null/key_vortex-contract
|
68
|
+
rubygems_mfa_required: 'true'
|
40
69
|
post_install_message:
|
41
70
|
rdoc_options: []
|
42
71
|
require_paths:
|
data/.rspec
DELETED