Skip to content

Commit

Permalink
update InvalidCommandImplementation
Browse files Browse the repository at this point in the history
  • Loading branch information
tycooon committed Mar 3, 2022
1 parent e05a808 commit 45da29f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/resol/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def call(*args, **kwargs, &block)
end

if result == :uncaught
error_message = "No success! or fail! called in the #call method in #{service.class}"
error_message = "No `#success!` or `#fail!` called in `#call` method in #{service.class}."
raise InvalidCommandImplementation, error_message
else
Resol::Success(result.data)
Expand Down
4 changes: 3 additions & 1 deletion spec/service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ def call
it "raises an InvalidCommandImplementation error" do
expect { EmptyService.call! }.to raise_error do |error|
expect(error).to be_a(EmptyService::InvalidCommandImplementation)
expect(error.message).to eq("No success! or fail! called in the #call method in EmptyService")
expect(error.message).to eq(
"No `#success!` or `#fail!` called in `#call` method in EmptyService.",
)
end
end

Expand Down

0 comments on commit 45da29f

Please sign in to comment.