flow 0.11.0 → 0.11.1

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: b58b685f68376d3cbb4e00e869d9f1a16d15ffb74fe13ed9c8088c89b5b915ca
4
- data.tar.gz: 0a9028c03e0c7196f4feb4a2744f00262d3b2799e8752a87e95484a0344d47ef
3
+ metadata.gz: a2cbf274b4eeeec407044f9e1fa36f9adbb4e764c80fcddf8341faf71e2f579a
4
+ data.tar.gz: 3ba508665ba607fdabc7fe878199133ac5d194889eb4d911ec5b22656c47ef23
5
5
  SHA512:
6
- metadata.gz: 9749b0bbbcb7a59ff426c81d0a1e5c05a913a383752afc641d8c90679b24f9a572873ad8efc9e7abaac8f19664f1b5e5e8b7474a71ab88f63abe04fcd1ba5bfa
7
- data.tar.gz: ef93d1bd2d6e73f417daebb0c6884fb323677a9ff322eb7be8577506ce75c5b0596a161a56e716b18f049dc3c0625488f90995b00218ce2c648f9d91a10f73e1
6
+ metadata.gz: d18ff6721175ce0189f883775bcc0953375837248ce8645c36ef5684d70f1dd47eb74cf5449c3a1e5d9dd0957058bd73a17dbd806108d2892218d42d40434c08
7
+ data.tar.gz: 7f60552c0bde342aa962eb6afee720f5d58cfe90ab63794457219c83a63724056833a6b482e81f192ee406288dc434f47ddd3b98e59b3eca0703ba5050d55746
data/README.md CHANGED
@@ -216,12 +216,12 @@ If the `Flow` fails you can see the failures on the instance:
216
216
 
217
217
  ## Wiki
218
218
 
219
- Learn more with our wiki [Getting Started](https://github.com/Freshly/flow/wiki/Getting-Started#installation) page.
219
+ Learn more with our wiki [Getting Started](https://github.com/RubyAfterAll/flow/wiki/Getting-Started#installation) page.
220
220
 
221
221
  You also can download wiki to have offline access.
222
222
  Just simply do:
223
223
 
224
- `git clone git@github.com:Freshly/flow.wiki.git`
224
+ `git clone git@github.com:RubyAfterAll/flow.wiki.git`
225
225
 
226
226
 
227
227
  ## License
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Stubs a given flow to always fail when triggered.
4
+ #
5
+ # Usage:
6
+ # describe SomeFlow do
7
+ # let(:flow) { described_class.new(some: :arguments) }
8
+ #
9
+ # include_context "with invalid state"
10
+ #
11
+ # before { flow.trigger }
12
+ #
13
+ # it "is failed" do
14
+ # expect(flow).not_to be_successful
15
+ # expect(flow.state.errors).to be_present
16
+ # end
17
+ # end
18
+ #
19
+ # Requires let variables to be defined in the inclusion context:
20
+ # * invalid_state_class - the state class that will be used for the flow
21
+ # * expected_state_errors - a hash in the form of:
22
+ # { attribute_name: :error_key
23
+ # # or:
24
+ # another_attributee: "error message!"
25
+ # }
26
+ RSpec.shared_context "with invalid state" do
27
+ before do
28
+ allow(invalid_state_class).to receive(:new).and_wrap_original do |mtd, **kwargs|
29
+ mtd.call(**kwargs).tap do |state|
30
+ allow(state).to receive(:run_validations!).and_wrap_original do |run_validations|
31
+ run_validations.call
32
+
33
+ expected_state_errors.each do |attr, error|
34
+ state.errors.add(attr, error)
35
+ end
36
+
37
+ false
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -1,3 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "shared_contexts/with_failing_operation"
4
+ require_relative "shared_contexts/with_invalid_state"
@@ -13,7 +13,7 @@ module Flow
13
13
 
14
14
  ActiveSupport::Deprecation.warn(
15
15
  "Direct state access of `#{method_name}' on #{_state.inspect} will be removed in a future version of flow. "\
16
- "Use a state accessor instead - for more information see github/freshly/flow/deprecation_notice"
16
+ "Use a state accessor instead - for more information see github/RubyAfterAll/flow/deprecation_notice"
17
17
  )
18
18
  _state.public_send(method_name, *arguments, &block)
19
19
  end
data/lib/flow/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Flow
4
- VERSION = "0.11.0"
4
+ VERSION = "0.11.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Garside
@@ -9,10 +9,10 @@ authors:
9
9
  - Jordan Minneti
10
10
  - Vinod Lala
11
11
  - Andrew Cross
12
- autorequire:
12
+ autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2021-09-01 00:00:00.000000000 Z
15
+ date: 2022-03-26 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activemodel
@@ -338,6 +338,7 @@ files:
338
338
  - lib/flow/rspec/custom_matchers/write_state.rb
339
339
  - lib/flow/rspec/shared_contexts.rb
340
340
  - lib/flow/rspec/shared_contexts/with_failing_operation.rb
341
+ - lib/flow/rspec/shared_contexts/with_invalid_state.rb
341
342
  - lib/flow/rspec/shoulda_matcher_helper.rb
342
343
  - lib/flow/spec_helper.rb
343
344
  - lib/flow/state_base.rb
@@ -381,11 +382,11 @@ files:
381
382
  - lib/generators/rspec/state/USAGE
382
383
  - lib/generators/rspec/state/state_generator.rb
383
384
  - lib/generators/rspec/state/templates/state_spec.rb.erb
384
- homepage: https://github.com/Freshly/flow
385
+ homepage: https://github.com/RubyAfterAll/flow
385
386
  licenses:
386
387
  - MIT
387
388
  metadata: {}
388
- post_install_message:
389
+ post_install_message:
389
390
  rdoc_options: []
390
391
  require_paths:
391
392
  - lib
@@ -400,8 +401,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
400
401
  - !ruby/object:Gem::Version
401
402
  version: '0'
402
403
  requirements: []
403
- rubygems_version: 3.2.25
404
- signing_key:
404
+ rubygems_version: 3.3.9
405
+ signing_key:
405
406
  specification_version: 4
406
407
  summary: Write modular and reusable business logic that's understandable and maintainable.
407
408
  test_files: []