Skip to content

Commit

Permalink
fix(can_have_fallbacks): use ConvenientService.raise
Browse files Browse the repository at this point in the history
  • Loading branch information
marian13 committed Jun 3, 2024
1 parent a19ce55 commit 148317d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def service
def refute_method_step!
return unless step.method_step?

raise Exceptions::MethodStepCanNotHaveFallback.new(step: step)
::ConvenientService.raise Exceptions::MethodStepCanNotHaveFallback.new(step: step)
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@ def foo
.to raise_error(ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step::Plugins::CanHaveFallbacks::Exceptions::MethodStepCanNotHaveFallback)
.with_message(exception_message)
end

specify do
expect { ignoring_exception(ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step::Plugins::CanHaveFallbacks::Exceptions::MethodStepCanNotHaveFallback) { method_value } }
.to delegate_to(ConvenientService, :raise)
end
end
end

Expand Down Expand Up @@ -512,6 +517,11 @@ def foo
.to raise_error(ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step::Plugins::CanHaveFallbacks::Exceptions::MethodStepCanNotHaveFallback)
.with_message(exception_message)
end

specify do
expect { ignoring_exception(ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step::Plugins::CanHaveFallbacks::Exceptions::MethodStepCanNotHaveFallback) { method_value } }
.to delegate_to(ConvenientService, :raise)
end
end
end

Expand Down Expand Up @@ -753,6 +763,11 @@ def foo
.to raise_error(ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step::Plugins::CanHaveFallbacks::Exceptions::MethodStepCanNotHaveFallback)
.with_message(exception_message)
end

specify do
expect { ignoring_exception(ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step::Plugins::CanHaveFallbacks::Exceptions::MethodStepCanNotHaveFallback) { method_value } }
.to delegate_to(ConvenientService, :raise)
end
end
end

Expand Down Expand Up @@ -943,6 +958,11 @@ def foo
.to raise_error(ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step::Plugins::CanHaveFallbacks::Exceptions::MethodStepCanNotHaveFallback)
.with_message(exception_message)
end

specify do
expect { ignoring_exception(ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step::Plugins::CanHaveFallbacks::Exceptions::MethodStepCanNotHaveFallback) { method_value } }
.to delegate_to(ConvenientService, :raise)
end
end
end

Expand Down Expand Up @@ -1178,6 +1198,11 @@ def foo
.to raise_error(ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step::Plugins::CanHaveFallbacks::Exceptions::MethodStepCanNotHaveFallback)
.with_message(exception_message)
end

specify do
expect { ignoring_exception(ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step::Plugins::CanHaveFallbacks::Exceptions::MethodStepCanNotHaveFallback) { method_value } }
.to delegate_to(ConvenientService, :raise)
end
end
end

Expand Down

0 comments on commit 148317d

Please sign in to comment.