spec/skala/transformation_spec.rb in skala-0.2.0 vs spec/skala/transformation_spec.rb in skala-0.3.0

- old
+ new

@@ -25,23 +25,32 @@ end describe "#abort!" do let(:transformation) do Class.new(described_class) do + def abort_execution? + !!@abort_execution + end + + def initialize(abort_execution = true) + @abort_execution = abort_execution + end + sequence [ -> (transformation) do transformation.target = "first_steps_output" - transformation.abort! + transformation.abort! if transformation.abort_execution? end, -> (transformation) do transformation.target = "second_steps_output" end ] - end.new + end end it "aborts the execution of the steps sequence" do - expect(transformation.apply to: {}).to eq("first_steps_output") + expect(transformation.new.apply to: {}).to eq("first_steps_output") + expect(transformation.new(false).apply to: {}).to eq("second_steps_output") end end describe "#apply" do let(:transformation) do