interactor 3.1.1 → 3.2.0
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/.github/workflows/tests.yml +31 -0
- data/.standard.yml +4 -0
- data/CHANGELOG.md +8 -0
- data/CONTRIBUTING.md +0 -10
- data/Gemfile +2 -0
- data/README.md +5 -4
- data/Rakefile +2 -1
- data/interactor.gemspec +10 -10
- data/lib/interactor/context.rb +33 -2
- data/lib/interactor/organizer.rb +1 -1
- data/lib/interactor.rb +4 -1
- data/spec/integration_spec.rb +276 -240
- data/spec/interactor/context_spec.rb +51 -8
- data/spec/spec_helper.rb +1 -1
- data/spec/support/lint.rb +13 -5
- metadata +20 -16
- data/.travis.yml +0 -35
data/spec/integration_spec.rb
CHANGED
@@ -296,18 +296,18 @@ describe "Integration" do
|
|
296
296
|
context.steps
|
297
297
|
}.from([]).to([
|
298
298
|
:around_before, :before,
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
299
|
+
:around_before2, :before2,
|
300
|
+
:around_before2a, :before2a, :call2a, :after2a, :around_after2a,
|
301
|
+
:around_before2b, :before2b, :call2b, :after2b, :around_after2b,
|
302
|
+
:around_before2c, :before2c, :call2c, :after2c, :around_after2c,
|
303
|
+
:after2, :around_after2,
|
304
|
+
:around_before3, :before3, :call3, :after3, :around_after3,
|
305
|
+
:around_before4, :before4,
|
306
|
+
:around_before4a, :before4a, :call4a, :after4a, :around_after4a,
|
307
|
+
:around_before4b, :before4b, :call4b, :after4b, :around_after4b,
|
308
|
+
:around_before4c, :before4c, :call4c, :after4c, :around_after4c,
|
309
|
+
:after4, :around_after4,
|
310
|
+
:around_before5, :before5, :call5, :after5, :around_after5,
|
311
311
|
:after, :around_after
|
312
312
|
])
|
313
313
|
end
|
@@ -348,9 +348,6 @@ describe "Integration" do
|
|
348
348
|
build_organizer(organize: [organizer2, interactor3, organizer4, interactor5]) do
|
349
349
|
around do |interactor|
|
350
350
|
raise "foo"
|
351
|
-
context.steps << :around_before
|
352
|
-
interactor.call
|
353
|
-
context.steps << :around_after
|
354
351
|
end
|
355
352
|
|
356
353
|
before do
|
@@ -366,7 +363,11 @@ describe "Integration" do
|
|
366
363
|
|
367
364
|
it "aborts" do
|
368
365
|
expect {
|
369
|
-
|
366
|
+
begin
|
367
|
+
organizer.call(context)
|
368
|
+
rescue
|
369
|
+
nil
|
370
|
+
end
|
370
371
|
}.not_to change {
|
371
372
|
context.steps
|
372
373
|
}
|
@@ -421,7 +422,6 @@ describe "Integration" do
|
|
421
422
|
|
422
423
|
before do
|
423
424
|
raise "foo"
|
424
|
-
context.steps << :before
|
425
425
|
end
|
426
426
|
|
427
427
|
after do
|
@@ -432,7 +432,11 @@ describe "Integration" do
|
|
432
432
|
|
433
433
|
it "aborts" do
|
434
434
|
expect {
|
435
|
-
|
435
|
+
begin
|
436
|
+
organizer.call(context)
|
437
|
+
rescue
|
438
|
+
nil
|
439
|
+
end
|
436
440
|
}.to change {
|
437
441
|
context.steps
|
438
442
|
}.from([]).to([
|
@@ -474,18 +478,18 @@ describe "Integration" do
|
|
474
478
|
context.steps
|
475
479
|
}.from([]).to([
|
476
480
|
:around_before, :before,
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
481
|
+
:around_before2, :before2,
|
482
|
+
:around_before2a, :before2a, :call2a, :after2a, :around_after2a,
|
483
|
+
:around_before2b, :before2b, :call2b, :after2b, :around_after2b,
|
484
|
+
:around_before2c, :before2c, :call2c, :after2c, :around_after2c,
|
485
|
+
:after2, :around_after2,
|
486
|
+
:around_before3, :before3, :call3, :after3, :around_after3,
|
487
|
+
:around_before4, :before4,
|
488
|
+
:around_before4a, :before4a, :call4a, :after4a, :around_after4a,
|
489
|
+
:around_before4b, :before4b, :call4b, :after4b, :around_after4b,
|
490
|
+
:around_before4c, :before4c, :call4c, :after4c, :around_after4c,
|
491
|
+
:after4, :around_after4,
|
492
|
+
:around_before5, :before5, :call5, :after5, :around_after5,
|
489
493
|
:rollback5,
|
490
494
|
:rollback4c,
|
491
495
|
:rollback4b,
|
@@ -513,30 +517,33 @@ describe "Integration" do
|
|
513
517
|
|
514
518
|
after do
|
515
519
|
raise "foo"
|
516
|
-
context.steps << :after
|
517
520
|
end
|
518
521
|
end
|
519
522
|
}
|
520
523
|
|
521
524
|
it "rolls back successfully called interactors and the failed interactor" do
|
522
525
|
expect {
|
523
|
-
|
526
|
+
begin
|
527
|
+
organizer.call(context)
|
528
|
+
rescue
|
529
|
+
nil
|
530
|
+
end
|
524
531
|
}.to change {
|
525
532
|
context.steps
|
526
533
|
}.from([]).to([
|
527
534
|
:around_before, :before,
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
535
|
+
:around_before2, :before2,
|
536
|
+
:around_before2a, :before2a, :call2a, :after2a, :around_after2a,
|
537
|
+
:around_before2b, :before2b, :call2b, :after2b, :around_after2b,
|
538
|
+
:around_before2c, :before2c, :call2c, :after2c, :around_after2c,
|
539
|
+
:after2, :around_after2,
|
540
|
+
:around_before3, :before3, :call3, :after3, :around_after3,
|
541
|
+
:around_before4, :before4,
|
542
|
+
:around_before4a, :before4a, :call4a, :after4a, :around_after4a,
|
543
|
+
:around_before4b, :before4b, :call4b, :after4b, :around_after4b,
|
544
|
+
:around_before4c, :before4c, :call4c, :after4c, :around_after4c,
|
545
|
+
:after4, :around_after4,
|
546
|
+
:around_before5, :before5, :call5, :after5, :around_after5,
|
540
547
|
:rollback5,
|
541
548
|
:rollback4c,
|
542
549
|
:rollback4b,
|
@@ -582,18 +589,18 @@ describe "Integration" do
|
|
582
589
|
context.steps
|
583
590
|
}.from([]).to([
|
584
591
|
:around_before, :before,
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
592
|
+
:around_before2, :before2,
|
593
|
+
:around_before2a, :before2a, :call2a, :after2a, :around_after2a,
|
594
|
+
:around_before2b, :before2b, :call2b, :after2b, :around_after2b,
|
595
|
+
:around_before2c, :before2c, :call2c, :after2c, :around_after2c,
|
596
|
+
:after2, :around_after2,
|
597
|
+
:around_before3, :before3, :call3, :after3, :around_after3,
|
598
|
+
:around_before4, :before4,
|
599
|
+
:around_before4a, :before4a, :call4a, :after4a, :around_after4a,
|
600
|
+
:around_before4b, :before4b, :call4b, :after4b, :around_after4b,
|
601
|
+
:around_before4c, :before4c, :call4c, :after4c, :around_after4c,
|
602
|
+
:after4, :around_after4,
|
603
|
+
:around_before5, :before5, :call5, :after5, :around_after5,
|
597
604
|
:after,
|
598
605
|
:rollback5,
|
599
606
|
:rollback4c,
|
@@ -614,7 +621,6 @@ describe "Integration" do
|
|
614
621
|
context.steps << :around_before
|
615
622
|
interactor.call
|
616
623
|
raise "foo"
|
617
|
-
context.steps << :around_after
|
618
624
|
end
|
619
625
|
|
620
626
|
before do
|
@@ -629,23 +635,27 @@ describe "Integration" do
|
|
629
635
|
|
630
636
|
it "rolls back successfully called interactors and the failed interactor" do
|
631
637
|
expect {
|
632
|
-
|
638
|
+
begin
|
639
|
+
organizer.call(context)
|
640
|
+
rescue
|
641
|
+
nil
|
642
|
+
end
|
633
643
|
}.to change {
|
634
644
|
context.steps
|
635
645
|
}.from([]).to([
|
636
646
|
:around_before, :before,
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
647
|
+
:around_before2, :before2,
|
648
|
+
:around_before2a, :before2a, :call2a, :after2a, :around_after2a,
|
649
|
+
:around_before2b, :before2b, :call2b, :after2b, :around_after2b,
|
650
|
+
:around_before2c, :before2c, :call2c, :after2c, :around_after2c,
|
651
|
+
:after2, :around_after2,
|
652
|
+
:around_before3, :before3, :call3, :after3, :around_after3,
|
653
|
+
:around_before4, :before4,
|
654
|
+
:around_before4a, :before4a, :call4a, :after4a, :around_after4a,
|
655
|
+
:around_before4b, :before4b, :call4b, :after4b, :around_after4b,
|
656
|
+
:around_before4c, :before4c, :call4c, :after4c, :around_after4c,
|
657
|
+
:after4, :around_after4,
|
658
|
+
:around_before5, :before5, :call5, :after5, :around_after5,
|
649
659
|
:after,
|
650
660
|
:rollback5,
|
651
661
|
:rollback4c,
|
@@ -700,11 +710,11 @@ describe "Integration" do
|
|
700
710
|
context.steps
|
701
711
|
}.from([]).to([
|
702
712
|
:around_before, :before,
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
713
|
+
:around_before2, :before2,
|
714
|
+
:around_before2a, :before2a, :call2a, :after2a, :around_after2a,
|
715
|
+
:around_before2b, :before2b, :call2b, :after2b, :around_after2b,
|
716
|
+
:around_before2c, :before2c, :call2c, :after2c, :around_after2c,
|
717
|
+
:after2, :around_after2,
|
708
718
|
:rollback2c,
|
709
719
|
:rollback2b,
|
710
720
|
:rollback2a
|
@@ -717,9 +727,6 @@ describe "Integration" do
|
|
717
727
|
build_interactor do
|
718
728
|
around do |interactor|
|
719
729
|
raise "foo"
|
720
|
-
context.steps << :around_before3
|
721
|
-
interactor.call
|
722
|
-
context.steps << :around_after3
|
723
730
|
end
|
724
731
|
|
725
732
|
before do
|
@@ -742,16 +749,20 @@ describe "Integration" do
|
|
742
749
|
|
743
750
|
it "rolls back successfully called interactors" do
|
744
751
|
expect {
|
745
|
-
|
752
|
+
begin
|
753
|
+
organizer.call(context)
|
754
|
+
rescue
|
755
|
+
nil
|
756
|
+
end
|
746
757
|
}.to change {
|
747
758
|
context.steps
|
748
759
|
}.from([]).to([
|
749
760
|
:around_before, :before,
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
761
|
+
:around_before2, :before2,
|
762
|
+
:around_before2a, :before2a, :call2a, :after2a, :around_after2a,
|
763
|
+
:around_before2b, :before2b, :call2b, :after2b, :around_after2b,
|
764
|
+
:around_before2c, :before2c, :call2c, :after2c, :around_after2c,
|
765
|
+
:after2, :around_after2,
|
755
766
|
:rollback2c,
|
756
767
|
:rollback2b,
|
757
768
|
:rollback2a
|
@@ -800,12 +811,12 @@ describe "Integration" do
|
|
800
811
|
context.steps
|
801
812
|
}.from([]).to([
|
802
813
|
:around_before, :before,
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
814
|
+
:around_before2, :before2,
|
815
|
+
:around_before2a, :before2a, :call2a, :after2a, :around_after2a,
|
816
|
+
:around_before2b, :before2b, :call2b, :after2b, :around_after2b,
|
817
|
+
:around_before2c, :before2c, :call2c, :after2c, :around_after2c,
|
818
|
+
:after2, :around_after2,
|
819
|
+
:around_before3,
|
809
820
|
:rollback2c,
|
810
821
|
:rollback2b,
|
811
822
|
:rollback2a
|
@@ -824,7 +835,6 @@ describe "Integration" do
|
|
824
835
|
|
825
836
|
before do
|
826
837
|
raise "foo"
|
827
|
-
context.steps << :before3
|
828
838
|
end
|
829
839
|
|
830
840
|
after do
|
@@ -843,17 +853,21 @@ describe "Integration" do
|
|
843
853
|
|
844
854
|
it "rolls back successfully called interactors" do
|
845
855
|
expect {
|
846
|
-
|
856
|
+
begin
|
857
|
+
organizer.call(context)
|
858
|
+
rescue
|
859
|
+
nil
|
860
|
+
end
|
847
861
|
}.to change {
|
848
862
|
context.steps
|
849
863
|
}.from([]).to([
|
850
864
|
:around_before, :before,
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
865
|
+
:around_before2, :before2,
|
866
|
+
:around_before2a, :before2a, :call2a, :after2a, :around_after2a,
|
867
|
+
:around_before2b, :before2b, :call2b, :after2b, :around_after2b,
|
868
|
+
:around_before2c, :before2c, :call2c, :after2c, :around_after2c,
|
869
|
+
:after2, :around_after2,
|
870
|
+
:around_before3,
|
857
871
|
:rollback2c,
|
858
872
|
:rollback2b,
|
859
873
|
:rollback2a
|
@@ -902,12 +916,12 @@ describe "Integration" do
|
|
902
916
|
context.steps
|
903
917
|
}.from([]).to([
|
904
918
|
:around_before, :before,
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
919
|
+
:around_before2, :before2,
|
920
|
+
:around_before2a, :before2a, :call2a, :after2a, :around_after2a,
|
921
|
+
:around_before2b, :before2b, :call2b, :after2b, :around_after2b,
|
922
|
+
:around_before2c, :before2c, :call2c, :after2c, :around_after2c,
|
923
|
+
:after2, :around_after2,
|
924
|
+
:around_before3, :before3,
|
911
925
|
:rollback2c,
|
912
926
|
:rollback2b,
|
913
927
|
:rollback2a
|
@@ -934,7 +948,6 @@ describe "Integration" do
|
|
934
948
|
|
935
949
|
def call
|
936
950
|
raise "foo"
|
937
|
-
context.steps << :call3
|
938
951
|
end
|
939
952
|
|
940
953
|
def rollback
|
@@ -945,17 +958,21 @@ describe "Integration" do
|
|
945
958
|
|
946
959
|
it "rolls back successfully called interactors" do
|
947
960
|
expect {
|
948
|
-
|
961
|
+
begin
|
962
|
+
organizer.call(context)
|
963
|
+
rescue
|
964
|
+
nil
|
965
|
+
end
|
949
966
|
}.to change {
|
950
967
|
context.steps
|
951
968
|
}.from([]).to([
|
952
969
|
:around_before, :before,
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
970
|
+
:around_before2, :before2,
|
971
|
+
:around_before2a, :before2a, :call2a, :after2a, :around_after2a,
|
972
|
+
:around_before2b, :before2b, :call2b, :after2b, :around_after2b,
|
973
|
+
:around_before2c, :before2c, :call2c, :after2c, :around_after2c,
|
974
|
+
:after2, :around_after2,
|
975
|
+
:around_before3, :before3,
|
959
976
|
:rollback2c,
|
960
977
|
:rollback2b,
|
961
978
|
:rollback2a
|
@@ -1004,12 +1021,12 @@ describe "Integration" do
|
|
1004
1021
|
context.steps
|
1005
1022
|
}.from([]).to([
|
1006
1023
|
:around_before, :before,
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1024
|
+
:around_before2, :before2,
|
1025
|
+
:around_before2a, :before2a, :call2a, :after2a, :around_after2a,
|
1026
|
+
:around_before2b, :before2b, :call2b, :after2b, :around_after2b,
|
1027
|
+
:around_before2c, :before2c, :call2c, :after2c, :around_after2c,
|
1028
|
+
:after2, :around_after2,
|
1029
|
+
:around_before3, :before3, :call3,
|
1013
1030
|
:rollback3,
|
1014
1031
|
:rollback2c,
|
1015
1032
|
:rollback2b,
|
@@ -1033,7 +1050,6 @@ describe "Integration" do
|
|
1033
1050
|
|
1034
1051
|
after do
|
1035
1052
|
raise "foo"
|
1036
|
-
context.steps << :after3
|
1037
1053
|
end
|
1038
1054
|
|
1039
1055
|
def call
|
@@ -1048,17 +1064,21 @@ describe "Integration" do
|
|
1048
1064
|
|
1049
1065
|
it "rolls back successfully called interactors and the failed interactor" do
|
1050
1066
|
expect {
|
1051
|
-
|
1067
|
+
begin
|
1068
|
+
organizer.call(context)
|
1069
|
+
rescue
|
1070
|
+
nil
|
1071
|
+
end
|
1052
1072
|
}.to change {
|
1053
1073
|
context.steps
|
1054
1074
|
}.from([]).to([
|
1055
1075
|
:around_before, :before,
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1076
|
+
:around_before2, :before2,
|
1077
|
+
:around_before2a, :before2a, :call2a, :after2a, :around_after2a,
|
1078
|
+
:around_before2b, :before2b, :call2b, :after2b, :around_after2b,
|
1079
|
+
:around_before2c, :before2c, :call2c, :after2c, :around_after2c,
|
1080
|
+
:after2, :around_after2,
|
1081
|
+
:around_before3, :before3, :call3,
|
1062
1082
|
:rollback3,
|
1063
1083
|
:rollback2c,
|
1064
1084
|
:rollback2b,
|
@@ -1108,12 +1128,12 @@ describe "Integration" do
|
|
1108
1128
|
context.steps
|
1109
1129
|
}.from([]).to([
|
1110
1130
|
:around_before, :before,
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1131
|
+
:around_before2, :before2,
|
1132
|
+
:around_before2a, :before2a, :call2a, :after2a, :around_after2a,
|
1133
|
+
:around_before2b, :before2b, :call2b, :after2b, :around_after2b,
|
1134
|
+
:around_before2c, :before2c, :call2c, :after2c, :around_after2c,
|
1135
|
+
:after2, :around_after2,
|
1136
|
+
:around_before3, :before3, :call3, :after3,
|
1117
1137
|
:rollback3,
|
1118
1138
|
:rollback2c,
|
1119
1139
|
:rollback2b,
|
@@ -1129,7 +1149,6 @@ describe "Integration" do
|
|
1129
1149
|
context.steps << :around_before3
|
1130
1150
|
interactor.call
|
1131
1151
|
raise "foo"
|
1132
|
-
context.steps << :around_after3
|
1133
1152
|
end
|
1134
1153
|
|
1135
1154
|
before do
|
@@ -1152,17 +1171,21 @@ describe "Integration" do
|
|
1152
1171
|
|
1153
1172
|
it "rolls back successfully called interactors and the failed interactor" do
|
1154
1173
|
expect {
|
1155
|
-
|
1174
|
+
begin
|
1175
|
+
organizer.call(context)
|
1176
|
+
rescue
|
1177
|
+
nil
|
1178
|
+
end
|
1156
1179
|
}.to change {
|
1157
1180
|
context.steps
|
1158
1181
|
}.from([]).to([
|
1159
1182
|
:around_before, :before,
|
1160
|
-
|
1161
|
-
|
1162
|
-
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1183
|
+
:around_before2, :before2,
|
1184
|
+
:around_before2a, :before2a, :call2a, :after2a, :around_after2a,
|
1185
|
+
:around_before2b, :before2b, :call2b, :after2b, :around_after2b,
|
1186
|
+
:around_before2c, :before2c, :call2c, :after2c, :around_after2c,
|
1187
|
+
:after2, :around_after2,
|
1188
|
+
:around_before3, :before3, :call3, :after3,
|
1166
1189
|
:rollback3,
|
1167
1190
|
:rollback2c,
|
1168
1191
|
:rollback2b,
|
@@ -1212,14 +1235,14 @@ describe "Integration" do
|
|
1212
1235
|
context.steps
|
1213
1236
|
}.from([]).to([
|
1214
1237
|
:around_before, :before,
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1222
|
-
|
1238
|
+
:around_before2, :before2,
|
1239
|
+
:around_before2a, :before2a, :call2a, :after2a, :around_after2a,
|
1240
|
+
:around_before2b, :before2b, :call2b, :after2b, :around_after2b,
|
1241
|
+
:around_before2c, :before2c, :call2c, :after2c, :around_after2c,
|
1242
|
+
:after2, :around_after2,
|
1243
|
+
:around_before3, :before3, :call3, :after3, :around_after3,
|
1244
|
+
:around_before4, :before4,
|
1245
|
+
:around_before4a, :before4a, :call4a, :after4a, :around_after4a,
|
1223
1246
|
:rollback4a,
|
1224
1247
|
:rollback3,
|
1225
1248
|
:rollback2c,
|
@@ -1234,9 +1257,6 @@ describe "Integration" do
|
|
1234
1257
|
build_interactor do
|
1235
1258
|
around do |interactor|
|
1236
1259
|
raise "foo"
|
1237
|
-
context.steps << :around_before4b
|
1238
|
-
interactor.call
|
1239
|
-
context.steps << :around_after4b
|
1240
1260
|
end
|
1241
1261
|
|
1242
1262
|
before do
|
@@ -1259,19 +1279,23 @@ describe "Integration" do
|
|
1259
1279
|
|
1260
1280
|
it "rolls back successfully called interactors" do
|
1261
1281
|
expect {
|
1262
|
-
|
1282
|
+
begin
|
1283
|
+
organizer.call(context)
|
1284
|
+
rescue
|
1285
|
+
nil
|
1286
|
+
end
|
1263
1287
|
}.to change {
|
1264
1288
|
context.steps
|
1265
1289
|
}.from([]).to([
|
1266
1290
|
:around_before, :before,
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1271
|
-
|
1272
|
-
|
1273
|
-
|
1274
|
-
|
1291
|
+
:around_before2, :before2,
|
1292
|
+
:around_before2a, :before2a, :call2a, :after2a, :around_after2a,
|
1293
|
+
:around_before2b, :before2b, :call2b, :after2b, :around_after2b,
|
1294
|
+
:around_before2c, :before2c, :call2c, :after2c, :around_after2c,
|
1295
|
+
:after2, :around_after2,
|
1296
|
+
:around_before3, :before3, :call3, :after3, :around_after3,
|
1297
|
+
:around_before4, :before4,
|
1298
|
+
:around_before4a, :before4a, :call4a, :after4a, :around_after4a,
|
1275
1299
|
:rollback4a,
|
1276
1300
|
:rollback3,
|
1277
1301
|
:rollback2c,
|
@@ -1322,15 +1346,15 @@ describe "Integration" do
|
|
1322
1346
|
context.steps
|
1323
1347
|
}.from([]).to([
|
1324
1348
|
:around_before, :before,
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
1349
|
+
:around_before2, :before2,
|
1350
|
+
:around_before2a, :before2a, :call2a, :after2a, :around_after2a,
|
1351
|
+
:around_before2b, :before2b, :call2b, :after2b, :around_after2b,
|
1352
|
+
:around_before2c, :before2c, :call2c, :after2c, :around_after2c,
|
1353
|
+
:after2, :around_after2,
|
1354
|
+
:around_before3, :before3, :call3, :after3, :around_after3,
|
1355
|
+
:around_before4, :before4,
|
1356
|
+
:around_before4a, :before4a, :call4a, :after4a, :around_after4a,
|
1357
|
+
:around_before4b,
|
1334
1358
|
:rollback4a,
|
1335
1359
|
:rollback3,
|
1336
1360
|
:rollback2c,
|
@@ -1351,7 +1375,6 @@ describe "Integration" do
|
|
1351
1375
|
|
1352
1376
|
before do
|
1353
1377
|
raise "foo"
|
1354
|
-
context.steps << :before4b
|
1355
1378
|
end
|
1356
1379
|
|
1357
1380
|
after do
|
@@ -1370,20 +1393,24 @@ describe "Integration" do
|
|
1370
1393
|
|
1371
1394
|
it "rolls back successfully called interactors" do
|
1372
1395
|
expect {
|
1373
|
-
|
1396
|
+
begin
|
1397
|
+
organizer.call(context)
|
1398
|
+
rescue
|
1399
|
+
nil
|
1400
|
+
end
|
1374
1401
|
}.to change {
|
1375
1402
|
context.steps
|
1376
1403
|
}.from([]).to([
|
1377
1404
|
:around_before, :before,
|
1378
|
-
|
1379
|
-
|
1380
|
-
|
1381
|
-
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1405
|
+
:around_before2, :before2,
|
1406
|
+
:around_before2a, :before2a, :call2a, :after2a, :around_after2a,
|
1407
|
+
:around_before2b, :before2b, :call2b, :after2b, :around_after2b,
|
1408
|
+
:around_before2c, :before2c, :call2c, :after2c, :around_after2c,
|
1409
|
+
:after2, :around_after2,
|
1410
|
+
:around_before3, :before3, :call3, :after3, :around_after3,
|
1411
|
+
:around_before4, :before4,
|
1412
|
+
:around_before4a, :before4a, :call4a, :after4a, :around_after4a,
|
1413
|
+
:around_before4b,
|
1387
1414
|
:rollback4a,
|
1388
1415
|
:rollback3,
|
1389
1416
|
:rollback2c,
|
@@ -1434,15 +1461,15 @@ describe "Integration" do
|
|
1434
1461
|
context.steps
|
1435
1462
|
}.from([]).to([
|
1436
1463
|
:around_before, :before,
|
1437
|
-
|
1438
|
-
|
1439
|
-
|
1440
|
-
|
1441
|
-
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1464
|
+
:around_before2, :before2,
|
1465
|
+
:around_before2a, :before2a, :call2a, :after2a, :around_after2a,
|
1466
|
+
:around_before2b, :before2b, :call2b, :after2b, :around_after2b,
|
1467
|
+
:around_before2c, :before2c, :call2c, :after2c, :around_after2c,
|
1468
|
+
:after2, :around_after2,
|
1469
|
+
:around_before3, :before3, :call3, :after3, :around_after3,
|
1470
|
+
:around_before4, :before4,
|
1471
|
+
:around_before4a, :before4a, :call4a, :after4a, :around_after4a,
|
1472
|
+
:around_before4b, :before4b,
|
1446
1473
|
:rollback4a,
|
1447
1474
|
:rollback3,
|
1448
1475
|
:rollback2c,
|
@@ -1471,7 +1498,6 @@ describe "Integration" do
|
|
1471
1498
|
|
1472
1499
|
def call
|
1473
1500
|
raise "foo"
|
1474
|
-
context.steps << :call4b
|
1475
1501
|
end
|
1476
1502
|
|
1477
1503
|
def rollback
|
@@ -1482,20 +1508,24 @@ describe "Integration" do
|
|
1482
1508
|
|
1483
1509
|
it "rolls back successfully called interactors" do
|
1484
1510
|
expect {
|
1485
|
-
|
1511
|
+
begin
|
1512
|
+
organizer.call(context)
|
1513
|
+
rescue
|
1514
|
+
nil
|
1515
|
+
end
|
1486
1516
|
}.to change {
|
1487
1517
|
context.steps
|
1488
1518
|
}.from([]).to([
|
1489
1519
|
:around_before, :before,
|
1490
|
-
|
1491
|
-
|
1492
|
-
|
1493
|
-
|
1494
|
-
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1520
|
+
:around_before2, :before2,
|
1521
|
+
:around_before2a, :before2a, :call2a, :after2a, :around_after2a,
|
1522
|
+
:around_before2b, :before2b, :call2b, :after2b, :around_after2b,
|
1523
|
+
:around_before2c, :before2c, :call2c, :after2c, :around_after2c,
|
1524
|
+
:after2, :around_after2,
|
1525
|
+
:around_before3, :before3, :call3, :after3, :around_after3,
|
1526
|
+
:around_before4, :before4,
|
1527
|
+
:around_before4a, :before4a, :call4a, :after4a, :around_after4a,
|
1528
|
+
:around_before4b, :before4b,
|
1499
1529
|
:rollback4a,
|
1500
1530
|
:rollback3,
|
1501
1531
|
:rollback2c,
|
@@ -1546,15 +1576,15 @@ describe "Integration" do
|
|
1546
1576
|
context.steps
|
1547
1577
|
}.from([]).to([
|
1548
1578
|
:around_before, :before,
|
1549
|
-
|
1550
|
-
|
1551
|
-
|
1552
|
-
|
1553
|
-
|
1554
|
-
|
1555
|
-
|
1556
|
-
|
1557
|
-
|
1579
|
+
:around_before2, :before2,
|
1580
|
+
:around_before2a, :before2a, :call2a, :after2a, :around_after2a,
|
1581
|
+
:around_before2b, :before2b, :call2b, :after2b, :around_after2b,
|
1582
|
+
:around_before2c, :before2c, :call2c, :after2c, :around_after2c,
|
1583
|
+
:after2, :around_after2,
|
1584
|
+
:around_before3, :before3, :call3, :after3, :around_after3,
|
1585
|
+
:around_before4, :before4,
|
1586
|
+
:around_before4a, :before4a, :call4a, :after4a, :around_after4a,
|
1587
|
+
:around_before4b, :before4b, :call4b,
|
1558
1588
|
:rollback4b,
|
1559
1589
|
:rollback4a,
|
1560
1590
|
:rollback3,
|
@@ -1580,7 +1610,6 @@ describe "Integration" do
|
|
1580
1610
|
|
1581
1611
|
after do
|
1582
1612
|
raise "foo"
|
1583
|
-
context.steps << :after4b
|
1584
1613
|
end
|
1585
1614
|
|
1586
1615
|
def call
|
@@ -1595,20 +1624,24 @@ describe "Integration" do
|
|
1595
1624
|
|
1596
1625
|
it "rolls back successfully called interactors and the failed interactor" do
|
1597
1626
|
expect {
|
1598
|
-
|
1627
|
+
begin
|
1628
|
+
organizer.call(context)
|
1629
|
+
rescue
|
1630
|
+
nil
|
1631
|
+
end
|
1599
1632
|
}.to change {
|
1600
1633
|
context.steps
|
1601
1634
|
}.from([]).to([
|
1602
1635
|
:around_before, :before,
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1607
|
-
|
1608
|
-
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1636
|
+
:around_before2, :before2,
|
1637
|
+
:around_before2a, :before2a, :call2a, :after2a, :around_after2a,
|
1638
|
+
:around_before2b, :before2b, :call2b, :after2b, :around_after2b,
|
1639
|
+
:around_before2c, :before2c, :call2c, :after2c, :around_after2c,
|
1640
|
+
:after2, :around_after2,
|
1641
|
+
:around_before3, :before3, :call3, :after3, :around_after3,
|
1642
|
+
:around_before4, :before4,
|
1643
|
+
:around_before4a, :before4a, :call4a, :after4a, :around_after4a,
|
1644
|
+
:around_before4b, :before4b, :call4b,
|
1612
1645
|
:rollback4b,
|
1613
1646
|
:rollback4a,
|
1614
1647
|
:rollback3,
|
@@ -1660,15 +1693,15 @@ describe "Integration" do
|
|
1660
1693
|
context.steps
|
1661
1694
|
}.from([]).to([
|
1662
1695
|
:around_before, :before,
|
1663
|
-
|
1664
|
-
|
1665
|
-
|
1666
|
-
|
1667
|
-
|
1668
|
-
|
1669
|
-
|
1670
|
-
|
1671
|
-
|
1696
|
+
:around_before2, :before2,
|
1697
|
+
:around_before2a, :before2a, :call2a, :after2a, :around_after2a,
|
1698
|
+
:around_before2b, :before2b, :call2b, :after2b, :around_after2b,
|
1699
|
+
:around_before2c, :before2c, :call2c, :after2c, :around_after2c,
|
1700
|
+
:after2, :around_after2,
|
1701
|
+
:around_before3, :before3, :call3, :after3, :around_after3,
|
1702
|
+
:around_before4, :before4,
|
1703
|
+
:around_before4a, :before4a, :call4a, :after4a, :around_after4a,
|
1704
|
+
:around_before4b, :before4b, :call4b, :after4b,
|
1672
1705
|
:rollback4b,
|
1673
1706
|
:rollback4a,
|
1674
1707
|
:rollback3,
|
@@ -1686,7 +1719,6 @@ describe "Integration" do
|
|
1686
1719
|
context.steps << :around_before4b
|
1687
1720
|
interactor.call
|
1688
1721
|
raise "foo"
|
1689
|
-
context.steps << :around_after4b
|
1690
1722
|
end
|
1691
1723
|
|
1692
1724
|
before do
|
@@ -1709,20 +1741,24 @@ describe "Integration" do
|
|
1709
1741
|
|
1710
1742
|
it "rolls back successfully called interactors and the failed interactor" do
|
1711
1743
|
expect {
|
1712
|
-
|
1744
|
+
begin
|
1745
|
+
organizer.call(context)
|
1746
|
+
rescue
|
1747
|
+
nil
|
1748
|
+
end
|
1713
1749
|
}.to change {
|
1714
1750
|
context.steps
|
1715
1751
|
}.from([]).to([
|
1716
1752
|
:around_before, :before,
|
1717
|
-
|
1718
|
-
|
1719
|
-
|
1720
|
-
|
1721
|
-
|
1722
|
-
|
1723
|
-
|
1724
|
-
|
1725
|
-
|
1753
|
+
:around_before2, :before2,
|
1754
|
+
:around_before2a, :before2a, :call2a, :after2a, :around_after2a,
|
1755
|
+
:around_before2b, :before2b, :call2b, :after2b, :around_after2b,
|
1756
|
+
:around_before2c, :before2c, :call2c, :after2c, :around_after2c,
|
1757
|
+
:after2, :around_after2,
|
1758
|
+
:around_before3, :before3, :call3, :after3, :around_after3,
|
1759
|
+
:around_before4, :before4,
|
1760
|
+
:around_before4a, :before4a, :call4a, :after4a, :around_after4a,
|
1761
|
+
:around_before4b, :before4b, :call4b, :after4b,
|
1726
1762
|
:rollback4b,
|
1727
1763
|
:rollback4a,
|
1728
1764
|
:rollback3,
|