teckel 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/teckel/chain/config.rb +3 -3
- data/lib/teckel/operation.rb +19 -9
- data/lib/teckel/operation/config.rb +2 -0
- data/lib/teckel/operation/runner.rb +26 -21
- data/lib/teckel/version.rb +1 -1
- data/spec/chain/default_settings_spec.rb +18 -18
- data/spec/chain/inheritance_spec.rb +44 -44
- data/spec/chain/none_input_spec.rb +16 -16
- data/spec/chain/results_spec.rb +28 -28
- data/spec/chain_around_hook_spec.rb +54 -54
- data/spec/chain_spec.rb +46 -46
- data/spec/operation/contract_trace_spec.rb +116 -0
- data/spec/operation/default_settings_spec.rb +12 -12
- data/spec/operation/inheritance_spec.rb +38 -38
- data/spec/operation/results_spec.rb +67 -67
- data/spec/operation_spec.rb +218 -220
- data/spec/rb27/pattern_matching_spec.rb +2 -2
- data/spec/result_spec.rb +8 -6
- metadata +9 -7
@@ -37,7 +37,7 @@ RSpec.describe "Ruby 2.7 pattern matches for Result and Chain" do
|
|
37
37
|
|
38
38
|
def call(usr)
|
39
39
|
Logger.new(File::NULL).info("User #{usr.name} created")
|
40
|
-
usr
|
40
|
+
success! usr
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
@@ -56,7 +56,7 @@ RSpec.describe "Ruby 2.7 pattern matches for Result and Chain" do
|
|
56
56
|
if settings&.fail_befriend
|
57
57
|
fail!(message: "Did not find a friend.")
|
58
58
|
else
|
59
|
-
|
59
|
+
success!(user: user, friend: User.new(name: "A friend", age: 42))
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
data/spec/result_spec.rb
CHANGED
@@ -3,15 +3,17 @@
|
|
3
3
|
require 'support/dry_base'
|
4
4
|
require 'support/fake_models'
|
5
5
|
|
6
|
+
module TeckelResultTest
|
7
|
+
class MissingResultImplementation
|
8
|
+
include Teckel::Result
|
9
|
+
def initialize(value, success); end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
6
13
|
RSpec.describe Teckel::Result do
|
7
14
|
describe "missing initialize" do
|
8
|
-
class MissingResultImplementation
|
9
|
-
include Teckel::Result
|
10
|
-
def initialize(value, success); end
|
11
|
-
end
|
12
|
-
|
13
15
|
specify do
|
14
|
-
result = MissingResultImplementation["value", true]
|
16
|
+
result = TeckelResultTest::MissingResultImplementation["value", true]
|
15
17
|
expect { result.successful? }.to raise_error(NotImplementedError)
|
16
18
|
expect { result.failure? }.to raise_error(NotImplementedError)
|
17
19
|
expect { result.value }.to raise_error(NotImplementedError)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teckel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Schulze
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -115,6 +115,7 @@ files:
|
|
115
115
|
- spec/chain_spec.rb
|
116
116
|
- spec/config_spec.rb
|
117
117
|
- spec/doctest_helper.rb
|
118
|
+
- spec/operation/contract_trace_spec.rb
|
118
119
|
- spec/operation/default_settings_spec.rb
|
119
120
|
- spec/operation/inheritance_spec.rb
|
120
121
|
- spec/operation/result_spec.rb
|
@@ -134,8 +135,8 @@ metadata:
|
|
134
135
|
changelog_uri: https://github.com/github.com/fnordfish/blob/master/CHANGELOG.md
|
135
136
|
source_code_uri: https://github.com/github.com/fnordfish
|
136
137
|
bug_tracker_uri: https://github.com/github.com/fnordfish/issues
|
137
|
-
documentation_uri: https://www.rubydoc.info/gems/teckel/0.
|
138
|
-
post_install_message:
|
138
|
+
documentation_uri: https://www.rubydoc.info/gems/teckel/0.6.0
|
139
|
+
post_install_message:
|
139
140
|
rdoc_options: []
|
140
141
|
require_paths:
|
141
142
|
- lib
|
@@ -150,8 +151,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
151
|
- !ruby/object:Gem::Version
|
151
152
|
version: '0'
|
152
153
|
requirements: []
|
153
|
-
rubygems_version: 3.
|
154
|
-
signing_key:
|
154
|
+
rubygems_version: 3.0.3
|
155
|
+
signing_key:
|
155
156
|
specification_version: 4
|
156
157
|
summary: Operations with enforced in/out/err data structures
|
157
158
|
test_files:
|
@@ -163,6 +164,7 @@ test_files:
|
|
163
164
|
- spec/chain_spec.rb
|
164
165
|
- spec/config_spec.rb
|
165
166
|
- spec/doctest_helper.rb
|
167
|
+
- spec/operation/contract_trace_spec.rb
|
166
168
|
- spec/operation/default_settings_spec.rb
|
167
169
|
- spec/operation/inheritance_spec.rb
|
168
170
|
- spec/operation/result_spec.rb
|