key_vortex-contract 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- 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 +29 -2
- 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: 3b2fa02c4b7d31b30196eb7daaa00ff8fa961947beff90ac1076a8c49eafa557
|
4
|
+
data.tar.gz: 5214da2d170bf4cae66bfc7f959faed06f26b0a1db4837f407f3c6eaeea9424f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 228bfec5bbce7bf2855079fad8ab0ac5221a7ea5f55c08b783c519fd8ffa7ef4875022b8c04a44dc5e3fed43f209323d4b160b8a9d1eceb544d8a6ca72460701
|
7
|
+
data.tar.gz: f06a98e0346c6b537ca1810c6259833528606f1ea511874a49f3047e7bf94100819fdc9a978fd3a0dda3331795eb8e42f8c05d82ca60fe1b65377370a4854584
|
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)
|
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,10 +28,17 @@ 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
|
|
@@ -28,4 +48,11 @@ RSpec.shared_context "an adapter" do
|
|
28
48
|
subject.remove(record.key)
|
29
49
|
expect(store.find(record.key)).to be_nil
|
30
50
|
end
|
51
|
+
|
52
|
+
it "recreates the class that was provided" do
|
53
|
+
store.save(record.key)
|
54
|
+
expect(store.find(record.key)).to be_a(SampleRecord)
|
55
|
+
store.save(record2)
|
56
|
+
expect(store.find(record2.key)).to be_a(SampleRecordTwo)
|
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
|
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